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