Class: Wamp::Manager::SubscribedEvent

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

Overview

Subscribe Event

Instance Attribute Summary

Attributes inherited from Base

#session

Instance Method Summary collapse

Methods inherited from Base

#auth, #authenticate, constantize, demodulize, #initialize, instance_from, #on_message, #run, #transmit

Constructor Details

This class inherits a constructor from Wamp::Manager::Base

Instance Method Details

#add_event_listener(listener) ⇒ Object



123
124
125
# File 'lib/wamp/manager/hello_event.rb', line 123

def add_event_listener(listener)
  session.on(listen_event_name, listener)
end

#emit_event(message) ⇒ Object



119
120
121
# File 'lib/wamp/manager/hello_event.rb', line 119

def emit_event(message)
  session.emit(emit_event_name, message)
end

#emit_event_nameObject



115
116
117
# File 'lib/wamp/manager/hello_event.rb', line 115

def emit_event_name
  "request_#{request_id}"
end

#listen_event_nameObject



127
128
129
# File 'lib/wamp/manager/hello_event.rb', line 127

def listen_event_name
  "event_#{subscription_id}"
end