Object
A member of the group
# File lib/celluloid/supervision_group.rb, line 110 def initialize(registry, klass, options = {}) @registry = registry @klass = klass # Stringify keys :/ options = options.inject({}) { |h,(k,v)| h[k.to_s] = v; h } @name = options['as'] @block = options['block'] @args = options['args'] ? Array(options['args']) : [] @method = options['method'] || 'new_link' @pool = @method == 'pool_link' @pool_size = options['size'] if @pool start end
# File lib/celluloid/supervision_group.rb, line 140 def restart(reason) @actor = nil @registry.delete(@name) if @name # Ignore supervisors that shut down cleanly return unless reason start end
# File lib/celluloid/supervision_group.rb, line 128 def start # when it is a pool, then we don't splat the args # and we need to extract the pool size if set if @pool options = {:args => @args} options[:size] = @pool_size if @pool_size @args = [options] end @actor = @klass.send(@method, *@args, &@block) @registry[@name] = @actor if @name end
Generated with the Darkfish Rdoc Generator 2.