Queue

new Queue(x, y, name, ttl, dlx, maxLength)

Queue class represents a component which keeps the messages until they are consumed.
Parameters:
NameTypeDescription
xnumberx position of the queue
ynumbery position of the queue
namestringoptional identifier
ttlnumber`x-message-ttl` Argument of the queue
dlxExchangeExchange object as `x-dead-letter-exchange` argument
maxLengthnumber`x-max-length` argument of the queue

Extends

Methods

addConsumer(consumer)

Adds a consumer to the queue.
Parameters:
NameTypeDescription
consumerConsumerConsumer object

addToScene(scene) → {object}

Add an object as actor to scene.
Parameters:
NameTypeDescription
sceneScenescene 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
Inherited From
Returns:
- uuid
Type: 
string

messageArrived(msg)

Handler for arriving messages.
Parameters:
NameTypeDescription
msgQueueMessageQueueMessage object

removeConsumer(consumer)

Removes a consumer from the queue.
Parameters:
NameTypeDescription
consumerConsumerConsumer object