Exchange

new Exchange(x, y, name, type, alternate)

Exchange class represents a component which receives messages and route them to queues.
Parameters:
NameTypeDescription
xnumberx position of the exchange
ynumbery position of the exchange
namestringidentifier
typestringexchange type
alternateExchangealternate exchange

Extends

Methods

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
msgExchangeMessage

removeBinding(binding)

Removes a binding from the exchange.
Parameters:
NameTypeDescription
bindingBindingBinding object

setAlternate(alternate)

Sets alternate exchange for exchange.
Parameters:
NameTypeDescription
alternateExchangealternate exchange