Class: Wamp::Client::Manager::Subscription
- Inherits:
-
BaseMultiple
- Object
- Base
- BaseMultiple
- Wamp::Client::Manager::Subscription
- Defined in:
- lib/wamp/client/manager/subscription.rb
Instance Attribute Summary
Attributes inherited from BaseMultiple
Attributes inherited from Base
#send_message_callback, #session
Instance Method Summary collapse
-
#event(message) ⇒ Object
Processes and incoming event.
Methods inherited from BaseMultiple
Methods inherited from Base
Constructor Details
This class inherits a constructor from Wamp::Client::Manager::BaseMultiple
Instance Method Details
#event(message) ⇒ Object
Processes and incoming event
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/wamp/client/manager/subscription.rb', line 29 def event() # Get the arguments subscription_id = .subscribed_subscription args = .publish_arguments || [] kwargs = .publish_argumentskw || {} # If we have a subscription, execute it subscription = self.objects[subscription_id] if subscription # Create the detials details = .details || {} details[:publication] = .published_publication details[:topic] = subscription.topic details[:session] = self.session # Call the handler handler = subscription.handler handler.call(args, kwargs, details) if handler end end |