Sha256: 01969b236f2a9ff7520c3f4cb6c3216663f6f3b619b88525f5c804ac4279481f

Contents?: true

Size: 864 Bytes

Versions: 1

Compression:

Stored size: 864 Bytes

Contents

require 'celluloid/io'

module Legion
  # Used to manage and start Celluloid and Supervisor
  class Supervision
    attr_accessor :supervision_group
    def initialize
      Legion::Logging.debug('Initializing Legion::Supervision')
      Legion::Logging.info('Starting Celluloid')
      Celluloid.logger = Legion::Logging
      start_supervision
    end

    def start_supervision
      Legion::Logging.debug('Starting Celluloid::Supervision::Container.run!')
      @supervision_group = Celluloid::Supervision::Container.run!
      Legion::Logging.info('Celluloid Supervisor has started')
    end

    def stop_supervision
      Legion::Logging.info('Shutting down the Supervision group')
      @supervision_group.shutdown
      sleep(1)
      Celluloid.shutdown
      Legion::Logging.info('Legion Celluloid Supervision Group has been shutdown')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
legionio-0.1.1 lib/legion/supervison.rb