Module: Wamp::Worker::BaseHandler::ClassMethods
- Defined in:
- lib/wamp/worker/handler.rb
Instance Method Summary collapse
-
#create(proxy, command, args, kwargs, details) ⇒ Object
Instantiates the object.
-
#register(procedure, method, name: nil, **options) ⇒ Object
Register the handler for a procedure.
-
#subscribe(topic, method, name: nil, **options) ⇒ Object
Subscribe the handler to a topic.
Instance Method Details
#create(proxy, command, args, kwargs, details) ⇒ Object
Instantiates the object
19 20 21 22 23 |
# 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) ⇒ Object
Register the handler for a procedure
42 43 44 45 46 47 |
# File 'lib/wamp/worker/handler.rb', line 42 def register(procedure, method, name: nil, **) klass = self Wamp::Worker::configure name do register procedure, klass, method, ** end end |
#subscribe(topic, method, name: nil, **options) ⇒ Object
Subscribe the handler to a topic
30 31 32 33 34 35 |
# File 'lib/wamp/worker/handler.rb', line 30 def subscribe(topic, method, name: nil, **) klass = self Wamp::Worker::configure name do subscribe topic, klass, method, ** end end |