Background:clearError (id) |
Clear error display (progress scope) |
Background:considerIdleProcessing (call) |
Background process for processing next photo or video in the catalog. |
Background:continue () |
Continue background task. |
Background:displayError (errm, id, immediate, call) |
Display background error as progress scope. |
Background:displayErrorX (options, fmt, ...) |
Display error, named options first, so remainder can be used for formatting & params. |
Background:finale (call) |
Background call finale. |
Background:init (call) |
Background init function. |
Background:initDone (call) |
call/called when background initialization is complete (after init hold-off time expires). |
Background:isPausing () |
Rarely used, but helps long-running background tasks to abort if user is trying to pause for foreground purposes. |
Background:main (call) |
Background initializer and optional main loop. |
Background:new (t) |
Constructor for new instance. |
Background:newClass (t) |
Constructor for extending class. |
Background:pause (tmo) |
Pause background task. |
Background:process (call) |
Background process function. |
Background:quit () |
Signal background task to quit. |
Background:start () |
Start's background initialization, followed by periodic background processing - if desired. |
Background:stop (tmo) |
Stop background task. |
Background:waitForIdle (tmo) |
Wait for background task to finish. |
Background:waitForInit (tmo, ival) |
Wait for asynchronous initialization to complete. |
- Background:clearError (id)
-
Clear error display (progress scope)
Parameters:
- Background:considerIdleProcessing (call)
-
Background process for processing next photo or video in the catalog.
Parameters:
Usage:
Called when nothing else to do in background process.
- Background:continue ()
-
Continue background task.
Usage:
No-op if not paused.
- Background:displayError (errm, id, immediate, call)
-
Display background error as progress scope.
Parameters:
-
errm
: - unparsed error message
-
id
:
-
immediate
:
-
call
: - call object containing background context.
Usage:
base class uses "genericBackgroundErrorId" for generic background error id. Derived classes may define additional error IDs for special purposes...
- Background:displayErrorX (options, fmt, ...)
-
Display error, named options first, so remainder can be used for formatting & params.
Parameters:
- Background:finale (call)
-
Background call finale.
Parameters:
Usage:
If overriding, you MUST set state to idle, or just call this from extended class method.
- Background:init (call)
-
Background init function.
Parameters:
-
call
: object - usually not needed, but its got the name, and context... just in case.
Usage:
override to do special initialization, if desired.
Try not to throw errors in init, but instead set initStatus to true or false depending on whether successful or not.
no need to call this method from extended class, yet.
if init is lengthy, check for shutdown sometimes and abort(return) if set - initStatus a dont care in that case.
- Background:initDone (call)
-
call/called when background initialization is complete (after init hold-off time expires).
Parameters:
- Background:isPausing ()
-
Rarely used, but helps long-running background tasks to abort if user is trying to pause for foreground purposes.
- Background:main (call)
-
Background initializer and optional main loop.
Parameters:
- Background:new (t)
-
Constructor for new instance.
Parameters:
-
t
: initialization table, including:
interval (number, default: 1 second) process frequency base-rate. Recommend .2 as normal minimum, .1 if process is quick and fast response is necessary.
minInitTime (number, default: 10 seconds), but recommend setting to 15 or 20 - so user has time to inspect startups in progress corner, or set to zero to suppress init progress indicator altogether.
- Background:newClass (t)
-
Constructor for extending class.
Parameters:
- Background:pause (tmo)
-
Pause background task.
Parameters:
Usage:
you must continue in finale method of call or service, lest background task dies forever.
- Background:process (call)
-
Background process function.
Parameters:
-
call
: object - usually not needed, but its got the name, and context... just in case.
- Background:quit ()
-
Signal background task to quit.
Usage:
Need not be called from task - does not wait for confirmation.
- Background:start ()
-
Start's background initialization, followed by periodic background processing - if desired.
Usage:
Generally called from init module if background auto-start is enabled. also called from plugin manager for start/stop on demand.
- Background:stop (tmo)
-
Stop background task.
Parameters:
-
tmo
: (number, required) - seconds to wait for stop confirmation.
Usage:
Return value:
confirmed (boolean) true iff stoppage confirmed.
- Background:waitForIdle (tmo)
-
Wait for background task to finish.
Parameters:
Usage:
Dont call unless you know its on its way out, e.g. shutdown for reload.
- Background:waitForInit (tmo, ival)
-
Wait for asynchronous initialization to complete.
Parameters:
-
tmo
: - initial timeout in seconds - default is half second.
-
ival
: - recheck interval if not finished initializing upon initial timeout - return immediately and do not prompt user if nil or zero. Ignored if tmo is zero.
Usage:
Untested @2011-01-08 ###2
Return values:
- status - true iff init completed successfully.
- explanation - if status false, is error message. if status true, indicates some waiting was required.