Module: SimpleWorker::AbstractWorker
- Included in:
- LocalWorker, SshWorker
- Defined in:
- lib/simpleworker/abstract_worker.rb
Instance Attribute Summary collapse
-
#cmd ⇒ Object
Returns the value of attribute cmd.
-
#script ⇒ Object
Returns the value of attribute script.
Instance Method Summary collapse
Instance Attribute Details
#cmd ⇒ Object
Returns the value of attribute cmd.
4 5 6 |
# File 'lib/simpleworker/abstract_worker.rb', line 4 def cmd @cmd end |
#script ⇒ Object
Returns the value of attribute script.
4 5 6 |
# File 'lib/simpleworker/abstract_worker.rb', line 4 def script @script end |
Instance Method Details
#env ⇒ Object
28 29 30 |
# File 'lib/simpleworker/abstract_worker.rb', line 28 def env @env end |
#start ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/simpleworker/abstract_worker.rb', line 6 def start if script.kind_of? Array @process = ChildProcess.build *script else @process = ChildProcess.build script end @process.io.inherit! set_process_env @process.start end |
#stop ⇒ Object
24 25 26 |
# File 'lib/simpleworker/abstract_worker.rb', line 24 def stop @process.stop end |
#wait ⇒ Object
20 21 22 |
# File 'lib/simpleworker/abstract_worker.rb', line 20 def wait @process.wait end |