new Consumer(x, y, name, consumes, mode)
Consumer class represents a component which consumes messages from a queue.
Parameters:
Name | Type | Description |
---|---|---|
x | number | x position of the consumer |
y | number | y position of the consumer |
name | string | optional identifier |
consumes | * | |
mode | string | ack or reject |
- Source
Extends
Methods
addQueue(queue)
Adds a queue to the list.
Parameters:
Name | Type | Description |
---|---|---|
queue | Queue | Queue object |
- Source
addToScene(scene) → {object}
Add an object as actor to scene.
Parameters:
Name | Type | Description |
---|---|---|
scene | Scene | scene on canvas |
- Inherited From
Returns:
this
- Type:
- object
createUUID() → {string}
Generates an UUID, used to identify every object in the scene.
https://www.w3resource.com/javascript-exercises/fundamental/javascript-fundamental-exercise-253.php
https://www.w3resource.com/javascript-exercises/fundamental/javascript-fundamental-exercise-253.php
- Inherited From
Returns:
- uuid
- Type:
- string
messageArrived(msg)
Handler for arriving messages. Checks the mode and reject or count the arrived messages.
Parameters:
Name | Type | Description |
---|---|---|
msg | QueueMessage | message object |
- Source
removeQueue(queue)
Removes a queue from the list or empty the list.
Parameters:
Name | Type | Description |
---|---|---|
queue | Queue | Queue object |
- Source