Sha256: 8bd247c6fe0202d2759220c4f4d6b6aa6de885a7c1ef8bbab81f7228cb14f3e5
Contents?: true
Size: 725 Bytes
Versions: 27
Compression:
Stored size: 725 Bytes
Contents
module Sidekiq module Extensions class Proxy < BasicObject def initialize(performable, target, options={}) @performable = performable @target = target @opts = options end def method_missing(name, *args) # Sidekiq has a limitation in that its message must be JSON. # JSON can't round trip real Ruby objects so we use YAML to # serialize the objects to a String. The YAML will be converted # to JSON and then deserialized on the other side back into a # Ruby object. obj = [@target, name, args] @performable.client_push({ 'class' => @performable, 'args' => [::YAML.dump(obj)] }.merge(@opts)) end end end end
Version data entries
27 entries across 27 versions & 2 rubygems