Class: FiberAudit::Runtime::Supervisor::SystemAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/fiber_audit/runtime/supervisor.rb

Instance Method Summary collapse

Instance Method Details

#kill(signal, pid) ⇒ Object



30
31
32
# File 'lib/fiber_audit/runtime/supervisor.rb', line 30

def kill(signal, pid)
  Process.kill(signal, pid)
end

#spawn(environment, command, cwd) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/fiber_audit/runtime/supervisor.rb', line 11

def spawn(environment, command, cwd)
  executable = command.fetch(0)
  Process.spawn(
    environment,
    [executable, executable],
    *command.drop(1),
    chdir: cwd,
    pgroup: true
  )
end

#trap(signal, handler = nil) ⇒ Object



26
27
28
# File 'lib/fiber_audit/runtime/supervisor.rb', line 26

def trap(signal, handler = nil, &)
  Signal.trap(signal, handler, &)
end

#wait2(pid) ⇒ Object



22
23
24
# File 'lib/fiber_audit/runtime/supervisor.rb', line 22

def wait2(pid)
  Process.wait2(pid)
end