Class: Process::Group::Command

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

Direct Known Subclasses

Fork, Spawn

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(foreground: false, **options) ⇒ Command

Returns a new instance of Command.



34
35
36
37
38
39
40
# File 'lib/process/group.rb', line 34

def initialize(foreground: false, **options)
	@options = options
	@foreground = foreground
	
	@fiber = Fiber.current
	@pid = nil
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



42
43
44
# File 'lib/process/group.rb', line 42

def options
  @options
end

#pidObject (readonly)

Returns the value of attribute pid.



44
45
46
# File 'lib/process/group.rb', line 44

def pid
  @pid
end

Instance Method Details

#foreground?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/process/group.rb', line 46

def foreground?
	@foreground
end

#kill(signal = :INT) ⇒ Object



54
55
56
# File 'lib/process/group.rb', line 54

def kill(signal = :INT)
	Process.kill(signal, @pid)
end

#resume(*arguments) ⇒ Object



50
51
52
# File 'lib/process/group.rb', line 50

def resume(*arguments)
	@fiber.resume(*arguments)
end