Sha256: 8944af0c1b698879c29863fb3b1893e52bf00a77524c3f4317928c9d84fd236f
Contents?: true
Size: 602 Bytes
Versions: 35
Compression:
Stored size: 602 Bytes
Contents
require 'sidekiq' require 'routemaster/jobs/job' module Routemaster module Jobs module Backends class Sidekiq def initialize(adapter = nil) @adapter = adapter || ::Sidekiq::Client end def enqueue(queue, job_class, *args) job_data = Job.data_for(job_class, args) @adapter.push('queue' => queue, 'class' => JobWrapper, 'args' => [job_data]) end class JobWrapper include ::Sidekiq::Worker def perform(job_data) Job.execute(job_data) end end end end end end
Version data entries
35 entries across 35 versions & 1 rubygems