Class: Celluloid::Supervision::Container

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/celluloid/supervision/container/pool.rb,
lib/celluloid/supervision/container/behavior/pool.rb

Defined Under Namespace

Classes: Instance, Pool

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.pool(klass, config, &block) ⇒ Object

Register a pool of actors to be launched on group startup


39
40
41
42
43
# File 'lib/celluloid/supervision/container/behavior/pool.rb', line 39

def pool(klass, config, &block)
  blocks << lambda do |container|
    container.pool(klass, config, &block)
  end
end

Instance Method Details

#pool(klass, config = {}, &block) ⇒ Object


28
29
30
31
# File 'lib/celluloid/supervision/container/behavior/pool.rb', line 28

def pool(klass, config={}, &block)
  _ = supervise(pooling_options(config, block: block, actors: klass))
  _.actors.last
end