Class: Wamp::Manager::PublishEvent

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

Overview

Publish Event

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



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_nameObject

Raises:

  • (NotImplementedError)


149
150
151
# File 'lib/wamp/manager/hello_event.rb', line 149

def emit_event_name
  raise NotImplementedError
end

#listen_event_nameObject



163
164
165
# File 'lib/wamp/manager/hello_event.rb', line 163

def listen_event_name
  "request_#{request_id}"
end