Class: Wamp::Worker::Proxy::Requestor

Inherits:
Base
  • Object
show all
Defined in:
lib/wamp/worker/proxy/requestor.rb

Direct Known Subclasses

Backgrounder

Instance Attribute Summary

Attributes inherited from Base

#name, #queue, #ticker, #uuid

Instance Method Summary collapse

Methods inherited from Base

#background_res_queue, #command_req_queue, #initialize, #unique_command_resp_queue

Constructor Details

This class inherits a constructor from Wamp::Worker::Proxy::Base

Instance Method Details

#call(procedure, args = nil, kwargs = nil, options = {}, &callback) ⇒ Object

Performs the session “call” method

Parameters:

  • procedure (String)
    • The procedure to call

  • args (Array) (defaults to: nil)
    • Array of arguments

  • kwargs (Hash) (defaults to: nil)
    • Hash of key/word arguments

  • options (Hash) (defaults to: {})
    • Options for the call



15
16
17
18
19
20
21
22
# File 'lib/wamp/worker/proxy/requestor.rb', line 15

def call(procedure, args=nil, kwargs=nil, options={}, &callback)

  # Create the params
  params = { procedure: procedure, args: args, kwargs: kwargs, options: options }

  # Execute the command
  request_response :call, params, true, &callback
end

#publish(topic, args = nil, kwargs = nil, options = {}, &callback) ⇒ Object

Performs the session “publish” method

Parameters:

  • topic (String)
    • The topic to publish

  • args (Array) (defaults to: nil)
    • Array of arguments

  • kwargs (Hash) (defaults to: nil)
    • Hash of key/word arguments

  • options (Hash) (defaults to: {})
    • Options for the subscribe



30
31
32
33
34
35
36
37
# File 'lib/wamp/worker/proxy/requestor.rb', line 30

def publish(topic, args=nil, kwargs=nil, options={}, &callback)

  # Create the params
  params = { topic: topic , args: args, kwargs: kwargs, options: options }

  # Execute the command
  request_response :publish, params, options[:acknowledge], &callback
end