new Producer(x, y, name, publishes)
Producer class represents a component that publishs against exchanges.
Parameters:
Name | Type | Description |
---|---|---|
x | number | x position of the producer |
y | number | y position of the producer |
name | string | optional identifier |
publishes | object | | list of exchanges to publish to |
- Source
Extends
Methods
addMessageToExchange(exchange, message)
Adds a message to an exchange.
Parameters:
Name | Type | Description |
---|---|---|
exchange | Exchange | Exchange object |
message | Object | JSON message with headers and body |
- 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
exchangeWithRoutingKeyExists(exchange, routingKey)
Checks for exchange in combination with routing key to exists.
Parameters:
Name | Type | Description |
---|---|---|
exchange | Exchange | Exchange object |
routingKey | string | routing key |
- Source
removeExchange(exchange)
Removes the exchange from the list.
Parameters:
Name | Type | Description |
---|---|---|
exchange | Exchange | Exchange object |
- Source
render()
Render the producer and draw lines to every exchange from the list.
- Source
update(dt)
Determines at which time a new message be published.
Parameters:
Name | Type | Description |
---|---|---|
dt | number | delta time from the timer |
- Source