Class: Wamp::Manager::CallEvent

Inherits:
Base
  • Object
show all
Defined in:
lib/wamp/manager/hello_event.rb

Overview

Call Message Decorator

Instance Attribute Summary

Attributes inherited from Base

#session

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



189
190
191
192
193
194
195
# File 'lib/wamp/manager/hello_event.rb', line 189

def add_event_listener(&block)
  session.on(listen_event_name) do |result, error|
    session.off(listen_event_name)
    block.call(result, error)
  end
  session.transmit(payload)
end

#listen_event_nameObject



185
186
187
# File 'lib/wamp/manager/hello_event.rb', line 185

def listen_event_name
  "request_#{request_id}"
end