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.
-
#reap_query ⇒ Object
readonly
Returns the value of attribute reap_query.
-
#start_query ⇒ Object
readonly
Returns the value of attribute start_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.
- #query(event) ⇒ Object
- #reap(&block) ⇒ Object
- #retry_options(options = {}) ⇒ Object
- #start(&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]) @reap_query = Blender::Task::Serf.new(name) @reap_query.payload([:reap]) @reap_query.timeout([:timeout]) @reap_query.no_ack([:no_ack]) @reap_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 |
#reap_query ⇒ Object (readonly)
Returns the value of attribute reap_query.
22 23 24 |
# File 'lib/blender/tasks/serf_async.rb', line 22 def reap_query @reap_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 |
Instance Method Details
#check(&block) ⇒ Object
59 60 61 |
# File 'lib/blender/tasks/serf_async.rb', line 59 def check(&block) @check_query.instance_eval(&block) end |
#command ⇒ Object
66 67 |
# File 'lib/blender/tasks/serf_async.rb', line 66 def command end |
#default_metadata ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/blender/tasks/serf_async.rb', line 73 def { ignore_failure: false, start: 'start', reap: 'reap', check: 'check', timeout: 5, no_ack: false, process: nil, retry_options: { intervals: Array.new(5, 30) } } end |
#execute ⇒ Object
63 64 |
# File 'lib/blender/tasks/serf_async.rb', line 63 def execute end |
#query(event) ⇒ Object
45 46 47 48 49 |
# File 'lib/blender/tasks/serf_async.rb', line 45 def query(event) @start_query.query(event) @reap_query.query(event) @check_query.query(event) end |
#reap(&block) ⇒ Object
55 56 57 |
# File 'lib/blender/tasks/serf_async.rb', line 55 def reap(&block) @reap_query.instance_eval(&block) end |
#retry_options(options = {}) ⇒ Object
69 70 71 |
# File 'lib/blender/tasks/serf_async.rb', line 69 def ( = {}) [:retry_options] = end |
#start(&block) ⇒ Object
51 52 53 |
# File 'lib/blender/tasks/serf_async.rb', line 51 def start(&block) @start_query.instance_eval(&block) end |