new worker(options)
The interface for the worker processes.
Parameters:
| Name | Type | Argument | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
The options hash.
Properties
|
- Source:
Methods
-
del(property, callback) → {undefined}
-
Deletes a property of the delegate on master.
Parameters:
Name Type Argument Description propertyString The name of the property to delete. callbackclusterproxy.worker~delCallback <optional>
The function that will be called after the property is deleted, with the old value. - Source:
Returns:
- Type
- undefined
-
get(property, callback) → {undefined}
-
Gets a property of the delegate on master.
Parameters:
Name Type Description propertyString The name of the property to get. callbackclusterproxy.worker~getCallback The function that will be called with the value of the property. - Source:
Returns:
- Type
- undefined
-
invoke(method, args, callback) → {undefined}
-
Calls a method of the delegate on master.
Parameters:
Name Type Argument Description methodString the name of the method to invoke on the delegate. args* <optional>
<repeatable>
Arguments for the invoked method. callbackclusterproxy.worker~invokeCallback <optional>
The function that will be called with the error code and the result of the method call. - Source:
Returns:
- Type
- undefined
-
invokeAsync(method, args, callback) → {undefined}
-
Calls a method of the delegate on master, with 'continuation passing style', assuming the last argument is the callback.
Parameters:
Name Type Argument Description methodString the name of the method to invoke on the delegate. args* <optional>
<repeatable>
Arguments for the invoked method, in the same order as in the invoked method. callbackclusterproxy.worker~invokeAsyncCallback The function that will be called with the error code and rest of the arguments that the invoked callback received. - Source:
Returns:
- Type
- undefined
-
invokeAsyncWithCallbackIndex(method, callbackIndex, args, callback) → {undefined}
-
Calls a method of the delegate on master, with 'continuation passing style'.
Parameters:
Name Type Argument Description methodString the name of the method to invoke on the delegate. callbackIndexNumber The index of the callback method on the invoked method arguments. args* <optional>
<repeatable>
Arguments for the invoked method, in the same order as in the invoked method (that is, the callback is in `callbackIndex+2` position; taking into account the two first arguments). callbackclusterproxy.worker~invokeAsyncCallback The function that will be called with the error code and rest of the arguments that the invokee callback received. - Source:
Returns:
- Type
- undefined
-
set(property, value, callback) → {undefined}
-
Sets a property of the delegate on mater.
Parameters:
Name Type Argument Description propertyString The name of the property to set. value* The value of the property to set. callbackclusterproxy.worker~setCallback <optional>
The function that will be called after the property is set, with the old value. - Source:
Returns:
- Type
- undefined
Type Definitions
-
delCallback(proxyError, oldValue)
-
Parameters:
Name Type Description proxyError* Any error coming from clusterproxy itself, or exceptions thrown deleting the property. oldValue* The old value of the deleted property. - Source:
-
getCallback(proxyError, value)
-
Parameters:
Name Type Description proxyError* Any error coming from clusterproxy itself, or exceptions thrown getting the property. value* The value of the property. - Source:
-
invokeAsyncCallback(proxyError, results)
-
Parameters:
Name Type Argument Description proxyError* Any error coming from clusterproxy itself, or exceptions thrown by the invoked method. results* <optional>
<repeatable>
Any arguments that the invokee callback received. For node/async style that means that the two first arguments might be error codes, but cluster proxy is agnostic to that. - Source:
-
invokeCallback(proxyError, result)
-
Parameters:
Name Type Argument Description proxyError* Any error coming from clusterproxy itself, or exceptions thrown by the invoked method. result* <optional>
The return value of the invoked method. - Source:
-
setCallback(proxyError, oldValue)
-
Parameters:
Name Type Description proxyError* Any error coming from clusterproxy itself, or exceptions thrown setting the property. oldValue* The old value of the set property. - Source: