Class: Wamp::Worker::Proxy::Backgrounder
- Defined in:
- lib/wamp/worker/proxy/backgrounder.rb
Instance Attribute Summary collapse
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(name, handle, uuid: nil) ⇒ Backgrounder
constructor
Constructor.
-
#yield(request, result, options = {}, check_defer = false) ⇒ Object
Returns the response to the dispatcher.
Methods inherited from Requestor
Methods inherited from Base
#background_res_queue, #command_req_queue, #unique_command_resp_queue
Constructor Details
#initialize(name, handle, uuid: nil) ⇒ Backgrounder
Constructor
12 13 14 15 |
# File 'lib/wamp/worker/proxy/backgrounder.rb', line 12 def initialize(name, handle, uuid: nil) super name, uuid: uuid @handle = handle end |
Instance Attribute Details
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
8 9 10 |
# File 'lib/wamp/worker/proxy/backgrounder.rb', line 8 def handle @handle end |
Instance Method Details
#yield(request, result, options = {}, check_defer = false) ⇒ Object
Returns the response to the dispatcher
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/wamp/worker/proxy/backgrounder.rb', line 23 def yield(request, result, ={}, check_defer=false) # Create the response object result = Wamp::Client::Response::CallResult.ensure(result, allow_error: true) # Create the params params = { request: request, result: result.to_hash, options: , check_defer: check_defer } # Push to the worker who requested the result self.queue.push self.handle, :yield, params end |