Sha256: 46c870bd15bbe42caa0d0a076fc61bab5ecf7bebeb7df09fc85bc8b2dbf18916

Contents?: true

Size: 675 Bytes

Versions: 19

Compression:

Stored size: 675 Bytes

Contents

require 'sidekiq/util'
require 'sidekiq/manager'
require 'sidekiq/scheduled'

module Sidekiq
  class Launcher
    attr_reader :manager, :poller, :options
    def initialize(options)
      @options = options
      @manager = Sidekiq::Manager.new(options)
      @poller  = Sidekiq::Scheduled::Poller.new
    end

    def run
      manager.async.start
      poller.async.poll(true)
    end

    def stop
      poller.async.terminate if poller.alive?
      manager.async.stop(:shutdown => true, :timeout => options[:timeout])
      manager.wait(:shutdown)
    end

    def procline(tag)
      $0 = manager.procline(tag)
      manager.after(5) { procline(tag) }
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
sidekiq-2.14.1 lib/sidekiq/launcher.rb
sidekiq-2.14.0 lib/sidekiq/launcher.rb
sidekiq-2.13.1 lib/sidekiq/launcher.rb
sidekiq-2.13.0 lib/sidekiq/launcher.rb
sidekiq-2.12.4 lib/sidekiq/launcher.rb
sidekiq-2.12.3 lib/sidekiq/launcher.rb
sidekiq-2.12.1 lib/sidekiq/launcher.rb
sidekiq-2.12.0 lib/sidekiq/launcher.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/sidekiq-2.11.2/lib/sidekiq/launcher.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/sidekiq-2.11.2/lib/sidekiq/launcher.rb
sidekiq-2.11.2 lib/sidekiq/launcher.rb
sidekiq-2.11.1 lib/sidekiq/launcher.rb
sidekiq-2.11.0 lib/sidekiq/launcher.rb
sidekiq-2.10.1 lib/sidekiq/launcher.rb
sidekiq-2.10.0 lib/sidekiq/launcher.rb
sidekiq-2.9.0 lib/sidekiq/launcher.rb
sidekiq-2.8.0 lib/sidekiq/launcher.rb
sidekiq-2.7.5 lib/sidekiq/launcher.rb
sidekiq-2.7.4 lib/sidekiq/launcher.rb