Class: Process::Group::Command
- Inherits:
-
Object
- Object
- Process::Group::Command
- Defined in:
- lib/process/group.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(arguments, options, fiber = Fiber.current) ⇒ Command
constructor
A new instance of Command.
- #resume(*arguments) ⇒ Object
- #run(options = {}) ⇒ Object
Constructor Details
#initialize(arguments, options, fiber = Fiber.current) ⇒ Command
Returns a new instance of Command.
27 28 29 30 31 32 |
# File 'lib/process/group.rb', line 27 def initialize(arguments, , fiber = Fiber.current) @arguments = arguments @options = @fiber = fiber end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
34 35 36 |
# File 'lib/process/group.rb', line 34 def arguments @arguments end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
35 36 37 |
# File 'lib/process/group.rb', line 35 def @options end |
Instance Method Details
#resume(*arguments) ⇒ Object
43 44 45 |
# File 'lib/process/group.rb', line 43 def resume(*arguments) @fiber.resume(*arguments) end |
#run(options = {}) ⇒ Object
37 38 39 40 41 |
# File 'lib/process/group.rb', line 37 def run( = {}) @pid = Process.spawn(*@arguments, @options.merge()) return @pid end |