Constructor
new WorkerManager(context, workerThread, defaultHandler, onError)
Class constructor
Parameters:
Name | Type | Description |
---|---|---|
context |
object | context in which it was created |
workerThread |
class | worker to control |
defaultHandler |
method | default handler |
onError |
method | what to do on error |
- Source:
Methods
_createWorker()
Creates worker
- Source:
removeHandler(name) → {object}
Removed handler
Parameters:
Name | Type | Description |
---|---|---|
name |
string | name of the handler to remove |
- Source:
Returns:
returns this
- Type
- object
sendWork() → {object}
Send work to the created worker
- Source:
Returns:
returns this
- Type
- object
setHandler(name, handlerFunction)
Set a new handler
Parameters:
Name | Type | Description |
---|---|---|
name |
string | handler name |
handlerFunction |
method | method to call when the handler is called |
- Source:
terminate() → {object}
Terminate the running worker
- Source:
Returns:
this
- Type
- object