Class: Async::Container::Forked

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

Overview

A multi-process container which uses Process.fork.

Direct Known Subclasses

Hybrid

Constant Summary

Constants inherited from Generic

Generic::UNNAMED

Instance Attribute Summary

Attributes inherited from Generic

#group, #state, #statistics

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Generic

#[], #async, #failed?, #initialize, #key?, #mark?, #reload, #run, run, #running?, #sleep, #spawn, #status?, #stop, #to_s, #wait, #wait_until_ready

Constructor Details

This class inherits a constructor from Async::Container::Generic

Class Method Details

.multiprocess?Boolean

Indicates that this is a multi-process container.

Returns:

  • (Boolean)


14
15
16
# File 'lib/async/container/forked.rb', line 14

def self.multiprocess?
  true
end

Instance Method Details

#start(name, &block) ⇒ Object

Start a named child process and execute the provided block in it.



21
22
23
# File 'lib/async/container/forked.rb', line 21

def start(name, &block)
  Process.fork(name: name, &block)
end