Class: Wamp::Manager::RegisteredEvent
- Defined in:
- lib/wamp/manager/hello_event.rb
Overview
Registered Message Decorator
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #add_event_listener(handler) ⇒ Object
- #emit_event_name ⇒ Object
-
#listen_event_name ⇒ Object
Adding listener for invocation message.
Methods inherited from Base
#auth, #authenticate, constantize, demodulize, #emit_event, #initialize, instance_from, #on_message, #run, #transmit
Constructor Details
This class inherits a constructor from Wamp::Manager::Base
Instance Method Details
#add_event_listener(handler) ⇒ Object
247 248 249 250 251 252 253 |
# File 'lib/wamp/manager/hello_event.rb', line 247 def add_event_listener(handler) session.on(listen_event_name) do |invocation| result = handler.call(invocation) = Message::Yield.new(invocation.request_id, {}, result) session.transmit(.payload) end end |
#emit_event_name ⇒ Object
238 239 240 |
# File 'lib/wamp/manager/hello_event.rb', line 238 def emit_event_name "request_#{request_id}" end |
#listen_event_name ⇒ Object
Adding listener for invocation message
243 244 245 |
# File 'lib/wamp/manager/hello_event.rb', line 243 def listen_event_name "registration_#{registration_id}" end |