Class: Async::Container::Threaded

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

Overview

A multi-thread container which uses Thread.fork.

Defined Under Namespace

Classes: Child

Constant Summary

Constants inherited from Generic

Generic::UNNAMED

Instance Attribute Summary

Attributes inherited from Generic

#The group of running children instances., #group, #state, #statistics

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Generic

#The state of each child instance.=, #[], #async, #failed?, #initialize, #key?, #mark?, #reload, run, #run, #running?, #size, #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 not a multi-process container.

Returns:

  • (Boolean)


15
16
17
# File 'lib/async/container/threaded.rb', line 15

def self.multiprocess?
	false
end

Instance Method Details

#start(name, &block) ⇒ Object

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



286
287
288
# File 'lib/async/container/threaded.rb', line 286

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