Class: Wamp::MessageHandler::Invocation

Inherits:
Base
  • Object
show all
Defined in:
lib/wamp/message_handler/invocation.rb

Overview

Call

Instance Attribute Summary

Attributes inherited from Base

#connection, #message

Instance Method Summary collapse

Methods inherited from Base

#initialize, #send_message

Constructor Details

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

Instance Method Details

#alt_store_keyObject



14
15
16
# File 'lib/wamp/message_handler/invocation.rb', line 14

def alt_store_key
  "registration_#{message.registration_id}"
end

#handleObject



7
8
9
10
11
12
# File 'lib/wamp/message_handler/invocation.rb', line 7

def handle
  connection.session.receive_message(message)
  data = store.fetch(alt_store_key)

  send_yield_message data.fetch(:handler)
end

#invocation_responseObject



18
19
20
21
22
23
# File 'lib/wamp/message_handler/invocation.rb', line 18

def invocation_response
  Type::Invocation.new(args: message.args, kwargs: message.kwargs, details: message.details).tap do |invocation|
    invocation.connection = connection
    invocation.request_id = message.request_id
  end
end