Class: Letterbox::Exchange
- Inherits:
-
Object
- Object
- Letterbox::Exchange
- Extended by:
- Forwardable
- Includes:
- Celluloid
- Defined in:
- lib/letterbox/exchange.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#unit_of_work ⇒ Object
readonly
Returns the value of attribute unit_of_work.
Instance Method Summary collapse
- #dispatch(payload, address) ⇒ Object
-
#initialize(unit_of_work) ⇒ Exchange
constructor
A new instance of Exchange.
Constructor Details
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
13 14 15 |
# File 'lib/letterbox/exchange.rb', line 13 def directory @directory end |
#unit_of_work ⇒ Object (readonly)
Returns the value of attribute unit_of_work.
13 14 15 |
# File 'lib/letterbox/exchange.rb', line 13 def unit_of_work @unit_of_work end |
Instance Method Details
#dispatch(payload, address) ⇒ Object
20 21 22 23 24 |
# File 'lib/letterbox/exchange.rb', line 20 def dispatch(payload, address) directory.send_to(address) { Address.new_link(Actor.current, unit_of_work) }.async.process(payload) end |