Sha256: 29f836ff0c65f4b12b9c2f56f3725e1b54966480c9619e409bf18c633966b755

Contents?: true

Size: 676 Bytes

Versions: 1

Compression:

Stored size: 676 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

1 entries across 1 versions & 1 rubygems

Version Path
sidekiq-2.7.3 lib/sidekiq/launcher.rb