Class: Process::Group::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/process/group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options, fiber = Fiber.current)
	@arguments = arguments
	@options = options

	@fiber = fiber
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



34
35
36
# File 'lib/process/group.rb', line 34

def arguments
  @arguments
end

#optionsObject (readonly)

Returns the value of attribute options.



35
36
37
# File 'lib/process/group.rb', line 35

def options
  @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(options = {})
	@pid = Process.spawn(*@arguments, @options.merge(options))
	
	return @pid
end