Class: Blender::Task::SerfAsync
- Inherits:
-
Base
- Object
- Base
- Blender::Task::SerfAsync
- Defined in:
- lib/blender/tasks/serf_async.rb
Instance Attribute Summary collapse
-
#check_query ⇒ Object
readonly
Returns the value of attribute check_query.
-
#start_query ⇒ Object
readonly
Returns the value of attribute start_query.
-
#stop_query ⇒ Object
readonly
Returns the value of attribute stop_query.
Instance Method Summary collapse
- #check(&block) ⇒ Object
- #command ⇒ Object
- #default_metadata ⇒ Object
- #execute ⇒ Object
-
#initialize(name, options = {}) ⇒ SerfAsync
constructor
A new instance of SerfAsync.
- #retry_options(options = {}) ⇒ Object
- #start(&block) ⇒ Object
- #stop(&block) ⇒ Object
Constructor Details
#initialize(name, options = {}) ⇒ SerfAsync
Returns a new instance of SerfAsync.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/blender/tasks/serf_async.rb', line 24 def initialize(name, = {}) super @start_query = Blender::Task::Serf.new(name) @start_query.payload([:start]) @start_query.timeout([:timeout]) @start_query.no_ack([:no_ack]) @start_query.process(&[:process]) @stop_query = Blender::Task::Serf.new(name) @stop_query.payload([:stop]) @stop_query.timeout([:timeout]) @stop_query.no_ack([:no_ack]) @stop_query.process(&[:process]) @check_query = Blender::Task::Serf.new(name) @check_query.payload([:check]) @check_query.timeout([:timeout]) @check_query.no_ack([:no_ack]) @check_query.process(&[:process]) end |
Instance Attribute Details
#check_query ⇒ Object (readonly)
Returns the value of attribute check_query.
22 23 24 |
# File 'lib/blender/tasks/serf_async.rb', line 22 def check_query @check_query end |
#start_query ⇒ Object (readonly)
Returns the value of attribute start_query.
22 23 24 |
# File 'lib/blender/tasks/serf_async.rb', line 22 def start_query @start_query end |
#stop_query ⇒ Object (readonly)
Returns the value of attribute stop_query.
22 23 24 |
# File 'lib/blender/tasks/serf_async.rb', line 22 def stop_query @stop_query end |
Instance Method Details
#check(&block) ⇒ Object
53 54 55 |
# File 'lib/blender/tasks/serf_async.rb', line 53 def check(&block) @check_query.instance_eval(&block) end |
#command ⇒ Object
60 61 |
# File 'lib/blender/tasks/serf_async.rb', line 60 def command end |
#default_metadata ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/blender/tasks/serf_async.rb', line 67 def { ignore_failure: false, start: 'start', stop: 'stop', check: 'check', timeout: 5, no_ack: false, process: nil, retry_options: { max_elapsed_time: 180 } } end |
#execute ⇒ Object
57 58 |
# File 'lib/blender/tasks/serf_async.rb', line 57 def execute end |
#retry_options(options = {}) ⇒ Object
63 64 65 |
# File 'lib/blender/tasks/serf_async.rb', line 63 def ( = {}) @metadata[:retry_options].merge!() end |
#start(&block) ⇒ Object
45 46 47 |
# File 'lib/blender/tasks/serf_async.rb', line 45 def start(&block) @start_query.instance_eval(&block) end |
#stop(&block) ⇒ Object
49 50 51 |
# File 'lib/blender/tasks/serf_async.rb', line 49 def stop(&block) @stop_query.instance_eval(&block) end |