Class: Proxy::RemoteExecution::Ssh::MQTT::Dispatcher
- Inherits:
-
Object
- Object
- Proxy::RemoteExecution::Ssh::MQTT::Dispatcher
- Includes:
- Singleton
- Defined in:
- lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb
Instance Attribute Summary collapse
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
Instance Method Summary collapse
- #done(uuid) ⇒ Object
-
#initialize ⇒ Dispatcher
constructor
A new instance of Dispatcher.
- #new(uuid, topic, payload) ⇒ Object
- #resend(uuid) ⇒ Object
- #running(uuid) ⇒ Object
Constructor Details
#initialize ⇒ Dispatcher
Returns a new instance of Dispatcher.
35 36 37 38 |
# File 'lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb', line 35 def initialize @supervisor = DispatcherSupervisor.spawn(name: 'RestartingSupervisor', args: []) @reference = @supervisor.ask!(:dispatcher_reference) end |
Instance Attribute Details
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
34 35 36 |
# File 'lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb', line 34 def reference @reference end |
Instance Method Details
#done(uuid) ⇒ Object
52 53 54 |
# File 'lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb', line 52 def done(uuid) reference.tell([:done, uuid]) end |
#new(uuid, topic, payload) ⇒ Object
40 41 42 |
# File 'lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb', line 40 def new(uuid, topic, payload) reference.tell([:new, uuid, topic, payload]) end |
#resend(uuid) ⇒ Object
48 49 50 |
# File 'lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb', line 48 def resend(uuid) reference.tell([:resend, uuid]) end |
#running(uuid) ⇒ Object
44 45 46 |
# File 'lib/smart_proxy_remote_execution_ssh/mqtt/dispatcher.rb', line 44 def running(uuid) reference.tell([:running, uuid]) end |