Class: Sidekiq::Compress::ClientMiddleware
- Inherits:
-
Object
- Object
- Sidekiq::Compress::ClientMiddleware
- Defined in:
- lib/sidekiq-compress/client_middleware.rb
Overview
Should be in the client middleware chain
Instance Method Summary collapse
-
#call(worker, msg, queue, redis_pool) ⇒ Object
Uses msg id and puts :queued status in the job’s Redis hash.
Instance Method Details
#call(worker, msg, queue, redis_pool) ⇒ Object
Uses msg id and puts :queued status in the job’s Redis hash
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/sidekiq-compress/client_middleware.rb', line 11 def call(worker, msg, queue, redis_pool) # return false/nil to stop the job from going to redis klass = msg["args"][0]["job_class"] || msg["class"] rescue msg["class"] job_class = klass.is_a?(Class) ? klass : Module.const_get(klass) unless job_class.ancestors.include?(Sidekiq::Compress) yield return end msg["args"] = Sidekiq::Compress::CompressParams.call(msg["args"]) yield end |