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

Version Path
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/sidekiq-2.11.2/lib/sidekiq/extensions/generic_proxy.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/sidekiq-2.11.2/lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.11.2 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.11.1 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.11.0 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.10.1 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.10.0 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.9.0 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.8.0 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.7.5 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.7.4 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.7.3 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.7.2 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.7.1 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.7.0 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.6.5 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.6.4 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.6.3 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.6.2 lib/sidekiq/extensions/generic_proxy.rb
sidekiq-2.6.1 lib/sidekiq/extensions/generic_proxy.rb