Home Manual Reference Source
public class | source

Queue

Extends:

src/mapping/core.js~Service → Queue

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 static get DEFAULT_DEPLOYMENT_ID: string: string source

Get default deployment id associated to Queue service

Return:

string

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:

NameTypeAttributeDescription
objectPattern {"description": *, "originBusinessId": *, "originDeploymentId": *, "data": *, "owner": *}
  • default: {"description":null,"originBusinessId":null,"originDeploymentId":null,"data":null,"owner":null}

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:

NameTypeAttributeDescription
objectPattern {"result": *, "taskId": *, "success": *}
  • default: {"result":null,"taskId":null,"success":null}

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:

NameTypeAttributeDescription
objectPattern {"capacity": *}
  • default: {"capacity":null}

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:

NameTypeAttributeDescription
objectPattern {"description": *, "originBusinessId": *, "originDeploymentId": *, "data": *, "owner": *}
  • default: {"description":null,"originBusinessId":null,"originDeploymentId":null,"data":null,"owner":null}

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:

*