Sha256: 3cabca4df8727d402923d222e9587c3d4cb7b948309f2c24ec91bdd1839145f9
Contents?: true
Size: 1 KB
Versions: 16
Compression:
Stored size: 1 KB
Contents
module Sidekiq class Client ## # The Sidekiq inline infrastructure overrides perform_async so that it # actually calls perform instead. This allows workers to be run inline in a # testing environment. # # This is similar to `Resque.inline = true` functionality. # # Example: # # require 'sidekiq/testing/inline' # # $external_variable = 0 # # class ExternalWorker # include Sidekiq::Worker # # def perform # $external_variable = 1 # end # end # # assert_equal 0, $external_variable # ExternalWorker.perform_async # assert_equal 1, $external_variable # singleton_class.class_eval do alias_method :raw_push_old, :raw_push def raw_push(payload) [payload].flatten.each do |item| marshalled = Sidekiq.load_json(Sidekiq.dump_json(item)) marshalled['class'].constantize.new.perform(*marshalled['args']) end true end end end end
Version data entries
16 entries across 16 versions & 2 rubygems