JAVASCRIPTworker

External objects

Properties Methods 

Properties

$callbackinstThe instance to which the worker object sends messages,for example when its processing has completed or has been cancelled.If you do not assign an instance to $callbackinst the worker object sends messages to itself
$errorcodeError code associated with the last action (zero means no error)
$errortextError text associated with the last action (empty means no error)
$stateA kWorkerState... constant that indicates the current state of the worker object
kWorkerStateCancelled kWorkerStateClear kWorkerStateComplete kWorkerStateInit kWorkerStateRunning
$threadcountThe number of active background threads for all instances of this type of worker object

Methods

$callmethod$callmethod(cModule,cMethod[,vListOrRow,bWait=kFalse,&cErrorText,vTag]) Call method optionally passing parameter which is the JavaScript object representation of vListOrRow.Optionally wait for the method to complete.Returns true if successful
$cancel$cancel() If required,cancels execution of worker on background thread.Will not return until the request has been cancelled
$cancelled$cancelled() Method called when the request has been cancelled
$init$init([cPath,bDebugNodeJs=kFalse]) Initialise the object so it is ready to execute JavaScript method calls.Returns true if successful
$methoderror$methoderror(wError) Method called to report the failure of an attempt to call a method with $callmethod
$methodreturn$methodreturn(wReturn) Method called with the results of a call to $callmethod
$start$start() Run worker on background thread.Returns true if the worker was successfully started
$workererror$workererror(wError) Method called to report errors from the worker that are not related to calling a method e.g. failure to start node.js.The worker thread exits after generating this notification