Class: Wamp::Manager::Event::Subscribed

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

Overview

Subscribed Message Event

Instance Attribute Summary

Attributes inherited from Base

#session

Instance Method Summary collapse

Methods inherited from Base

#emit_event, #error?, #initialize, #transmit

Constructor Details

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

Instance Method Details

#add_event_listener(listener) ⇒ Object



10
11
12
13
14
# File 'lib/wamp/manager/event/subscribed.rb', line 10

def add_event_listener(listener)
  session.on(listen_event_name) do |event|
    listener.call(*event.args, **event.kwargs)
  end
end

#emit_event_nameObject



16
17
18
# File 'lib/wamp/manager/event/subscribed.rb', line 16

def emit_event_name
  "request_#{request_id}"
end

#listen_event_nameObject



20
21
22
# File 'lib/wamp/manager/event/subscribed.rb', line 20

def listen_event_name
  "event_#{subscription_id}"
end