module Wamp::Worker::BaseHandler::ClassMethods

Public Instance Methods

create(proxy, command, args, kwargs, details) click to toggle source

Instantiates the object

# File lib/wamp/worker/handler.rb, line 19
def create(proxy, command, args, kwargs, details)
  handler = self.new
  handler.configure(proxy, command, args, kwargs, details)
  handler
end
register(procedure, method, name: nil, **options) click to toggle source

Register the handler for a procedure

@param procedure [String] - The procedure to register for @param method [Symbol] - The name of the method to execute @param options [Hash] - Options for the subscription

# File lib/wamp/worker/handler.rb, line 42
def register(procedure, method, name: nil, **options)
  klass = self
  Wamp::Worker::configure name do
    register procedure, klass, method, **options
  end
end
subscribe(topic, method, name: nil, **options) click to toggle source

Subscribe the handler to a topic

@param topic [String] - The topic to subscribe to @param method [Symbol] - The name of the method to execute @param options [Hash] - Options for the subscription

# File lib/wamp/worker/handler.rb, line 30
def subscribe(topic, method, name: nil, **options)
  klass = self
  Wamp::Worker::configure name do
    subscribe topic, klass, method, **options
  end
end