new Queue(x, y, name, ttl, dlx, maxLength)
Queue class represents a component which keeps the messages until they are consumed.
Parameters:
Name | Type | Description |
---|---|---|
x | number | x position of the queue |
y | number | y position of the queue |
name | string | optional identifier |
ttl | number | `x-message-ttl` Argument of the queue |
dlx | Exchange | Exchange object as `x-dead-letter-exchange` argument |
maxLength | number | `x-max-length` argument of the queue |
Extends
Methods
addConsumer(consumer)
Adds a consumer to the queue.
Parameters:
Name | Type | Description |
---|---|---|
consumer | Consumer | Consumer object |
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.
Parameters:
Name | Type | Description |
---|---|---|
msg | QueueMessage | QueueMessage object |
removeConsumer(consumer)
Removes a consumer from the queue.
Parameters:
Name | Type | Description |
---|---|---|
consumer | Consumer | Consumer object |