File RpcBackground.lua
Functions
RpcBackground:init (call) | RpcBackground init function. |
RpcBackground:new (t) | Constructor for new instance. |
RpcBackground:newClass (t) | Constructor for extending class. |
RpcBackground:process (call) | RpcBackground process function. |
RpcBackground:sendAndReceive (command, ...) | Send command & receive response. |
Functions
- RpcBackground:init (call)
-
RpcBackground 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.
-
- RpcBackground: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.
-
- RpcBackground:newClass (t)
-
Constructor for extending class.
Parameters:
-
t
:
-
- RpcBackground:process (call)
-
RpcBackground process function.
Parameters:
-
call
: object - usually not needed, but its got the name, and context... just in case.
Usage:
Extending class should call this method, if not every time, every other time...
Sends command to solicit app. if app returns command its processed and the response transmitted.
App must distinguish messages that warrant a response and those that are replies, the app response to a reply should always simply be 'true'.
-
- RpcBackground:sendAndReceive (command, ...)
-
Send command & receive response.
Parameters:
-
command
: -
...
:
Usage:
Use this instead of xml-rpc methods, since this coordinates with initialization and other tasks trying to do same...
-