Class: Wamp::Manager::PublishEvent
- Defined in:
- lib/wamp/manager/hello_event.rb
Overview
Publish Event
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
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(&block) ⇒ Object
153 154 155 156 157 158 159 160 161 |
# File 'lib/wamp/manager/hello_event.rb', line 153 def add_event_listener(&block) session.transmit(payload) return unless block_given? session.on(listen_event_name) do |publication| session.off(listen_event_name) block.call(publication, nil) end end |
#emit_event_name ⇒ Object
149 150 151 |
# File 'lib/wamp/manager/hello_event.rb', line 149 def emit_event_name raise NotImplementedError end |
#listen_event_name ⇒ Object
163 164 165 |
# File 'lib/wamp/manager/hello_event.rb', line 163 def listen_event_name "request_#{request_id}" end |