Class: RemoteService::Call
- Inherits:
-
Object
- Object
- RemoteService::Call
- Defined in:
- lib/remote_service/call.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(queue, action, params, timeout:) ⇒ Call
constructor
A new instance of Call.
- #run(&block) ⇒ Object
Constructor Details
#initialize(queue, action, params, timeout:) ⇒ Call
Returns a new instance of Call.
5 6 7 8 9 10 |
# File 'lib/remote_service/call.rb', line 5 def initialize(queue, action, params, timeout:) @queue = queue @action = action @params = params @timeout = (timeout || 10) / 1000.0 end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
3 4 5 |
# File 'lib/remote_service/call.rb', line 3 def action @action end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'lib/remote_service/call.rb', line 3 def params @params end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
3 4 5 |
# File 'lib/remote_service/call.rb', line 3 def queue @queue end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
3 4 5 |
# File 'lib/remote_service/call.rb', line 3 def timeout @timeout end |
Instance Method Details
#run(&block) ⇒ Object
12 13 14 15 |
# File 'lib/remote_service/call.rb', line 12 def run(&block) return call_service_synchronously if !block_given? call_service(&block) end |