Queue
Extends:
Producer / consumer real-time API
Task producers submits their tasks. The server dispatches the tasks. Consumers process them and report completion back to the server. Tasks are global to the service (i.e. NOT per user).
Static Member Summary
Static Public Members | ||
public static get |
Get default deployment id associated to Queue service |
Method Summary
Public Methods | ||
public |
call(objectPattern: {"description": *, "originBusinessId": *, "originDeploymentId": *, "data": *, "owner": *}): * Submits a task |
|
public |
done(objectPattern: {"result": *, "taskId": *, "success": *}): * Notifies completion of a task |
|
public |
register(objectPattern: {"capacity": *}): * Registers a consumer |
|
public |
submit(objectPattern: {"description": *, "originBusinessId": *, "originDeploymentId": *, "data": *, "owner": *}): * Submits a task |
|
public |
unregister(): * Unregisters a consumer |
Static Public Members
Public Methods
public call(objectPattern: {"description": *, "originBusinessId": *, "originDeploymentId": *, "data": *, "owner": *}): * source
Submits a task
Producer API. A task producer submits the given task to the server. The server will find a tasker with processing capacity and dispatch the task. The task result will be returned to the caller. When called from inside a macro, the comsumer generated result is available for further use.
Params:
Name | Type | Attribute | Description |
objectPattern | {"description": *, "originBusinessId": *, "originDeploymentId": *, "data": *, "owner": *} |
|
Return:
* |
public done(objectPattern: {"result": *, "taskId": *, "success": *}): * source
Notifies completion of a task
Consumer API. The tasker notifies completion of the given task to the server. The tasker can optionally include a result or an error code.
Params:
Name | Type | Attribute | Description |
objectPattern | {"result": *, "taskId": *, "success": *} |
|
Return:
* |
public register(objectPattern: {"capacity": *}): * source
Registers a consumer
Consumer API. Registers the current user resource as an available task consumer. Tasks will be then dispatched to that consumer.
Params:
Name | Type | Attribute | Description |
objectPattern | {"capacity": *} |
|
Return:
* |
public submit(objectPattern: {"description": *, "originBusinessId": *, "originDeploymentId": *, "data": *, "owner": *}): * source
Submits a task
Producer API. A task producer submits the given task to the server. The server will find a tasker with processing capacity and dispatch the task. The task result will be ignored : the producer will not receive any notification of any kind, even in case of errors (including capacity exceeded errors). This verb will return immediately : you can use this API to asynchronously submit a task.
Params:
Name | Type | Attribute | Description |
objectPattern | {"description": *, "originBusinessId": *, "originDeploymentId": *, "data": *, "owner": *} |
|
Return:
* |
public unregister(): * source
Unregisters a consumer
Consumer API. Unregisters the current user resource as an available task consumer. All non finished tasks are returned to the server.
Return:
* |