Class: Async::Container::Threaded::Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/async/container/threaded.rb

Instance Method Summary collapse

Constructor Details

#initialize(thread) ⇒ Instance



32
33
34
# File 'lib/async/container/threaded.rb', line 32

def initialize(thread)
  @thread = thread
end

Instance Method Details

#exec(*arguments) ⇒ Object



40
41
42
43
44
45
46
# File 'lib/async/container/threaded.rb', line 40

def exec(*arguments)
  pid = ::Process.spawn(*arguments)
  
  ::Process.waitpid(pid)
ensure
  ::Process.kill(:TERM, pid)
end

#name=(value) ⇒ Object



36
37
38
# File 'lib/async/container/threaded.rb', line 36

def name= value
  @thread.name = value
end