Sha256: 26b49fb0d4f1eab745584082577af5fcc21be7ea2e138617740fb38e9ed93658

Contents?: true

Size: 862 Bytes

Versions: 6

Compression:

Stored size: 862 Bytes

Contents

module Celluloid
  module Supervision
    class Container
      #       class << self
      #         def tree(actors=[], *args, &block)
      #           blocks << lambda do |container|
      #             container.tree(Configuration.options(args, :supervise => actors, :block => block ))
      #           end
      #         end
      #       end

      class Tree
        include Behavior

        identifier! :supervises, :supervise

        configuration do
          if @configuration[:supervise].is_a? Array
            @supervisor = @configuration.dup
            @branch = @configuration.fetch(:branch, @configuration[:as])
            @configuration.delete(Behavior.parameter(:supervise, @configuration))
          else
            fail ArgumentError.new("No actors given to Tree to supervise.")
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
celluloid-supervision-0.20.0 lib/celluloid/supervision/container/behavior/tree.rb
celluloid-supervision-0.20.0.pre6 lib/celluloid/supervision/container/behavior/tree.rb
celluloid-supervision-0.20.0.pre5 lib/celluloid/supervision/container/behavior/tree.rb
celluloid-supervision-0.20.0.pre4 lib/celluloid/supervision/container/behavior/tree.rb
celluloid-supervision-0.20.0.pre2 lib/celluloid/supervision/container/behavior/tree.rb
celluloid-supervision-0.20.0.pre1 lib/celluloid/supervision/container/behavior/tree.rb