Sha256: 901f3928caa4054dd4eb41281c3fbbc3cfac33a9ee95129f31467aeaecf87470

Contents?: true

Size: 859 Bytes

Versions: 2

Compression:

Stored size: 859 Bytes

Contents

# collect together all instances of the `supervise` method
module Celluloid
  class << self
    def supervise(config={}, &block)
      supervisor = Supervision.router(config)
      supervisor.supervise(config, &block)
    end
  end
  module ClassMethods
    def supervise(config={}, &block)
      Celluloid.supervise(config.merge(type: self), &block)
    end
  end
  module Supervision
    class << self
      def router(_config={})
        # TODO: Actually route.
        Celluloid.services # for now, hardcode .services
      end
    end
    class Container
      class << self
        def supervise(config, &block)
          blocks << lambda do |container|
            container.add(config, &block)
          end
        end
      end
      def supervise(config, &block)
        add(Configuration.options(config, block: block))
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
celluloid-supervision-0.20.6 lib/celluloid/supervision/supervise.rb
celluloid-supervision-0.20.5 lib/celluloid/supervision/supervise.rb