Sha256: 0976f25d6a1a0077bf224f29b9a6e552f46430fb6f175511dab0be3a97d4490b

Contents?: true

Size: 615 Bytes

Versions: 10

Compression:

Stored size: 615 Bytes

Contents

module Beanstalker
  class DaemonizerHandler < Daemonizer::Handler
    def prepare(block)
      logger.info "Loading Rails"
      require File.join(Daemonizer.root, '/config/environment')
      require 'beanstalker/worker'
      logger.info "Rails loaded"
      super
    end
    
    def start
      $logger = logger
      $logger.info "Starting cycle"
      Worker.new(binding, 
                :tube => option(:tube), 
                :servers => option(:servers),
                :worker_id => worker_id, 
                :workers_count => workers_count).run
      $logger.info "Ending cycle"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
beanstalker-0.3.6 lib/beanstalker/daemonizer_handler.rb
beanstalker-0.3.5 lib/beanstalker/daemonizer_handler.rb
beanstalker-0.3.4 lib/beanstalker/daemonizer_handler.rb
beanstalker-0.3.3 lib/beanstalker/daemonizer_handler.rb
beanstalker-0.3.2 lib/beanstalker/daemonizer_handler.rb
beanstalker-0.3.1 lib/beanstalker/daemonizer_handler.rb
beanstalker-0.3.0 lib/beanstalker/daemonizer_handler.rb
beanstalker-0.1.7 lib/beanstalker/daemonizer_handler.rb
beanstalker-0.1.6 lib/beanstalker/daemonizer_handler.rb
beanstalker-0.1.5 lib/beanstalker/daemonizer_handler.rb