Class: Async::Container::Threaded::Instance
- Inherits:
-
Object
- Object
- Async::Container::Threaded::Instance
- Defined in:
- lib/async/container/threaded.rb
Instance Method Summary collapse
- #exec(*arguments) ⇒ Object
-
#initialize(thread) ⇒ Instance
constructor
A new instance of Instance.
- #name=(value) ⇒ Object
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 |