Sha256: f5bdd34d029d7302e19fe92f193f653ca94d5ff7b53eb073a44e0cba37eac2c9

Contents?: true

Size: 578 Bytes

Versions: 3

Compression:

Stored size: 578 Bytes

Contents

require 'resque'
require 'backgrounded/handler/abstract_handler'

# handler that acts like the in process handler but marshalls the arguments
# this simulates how resque encodes/decodes values to/from redis
# useful when passing symbols to arguments and they end up being processed as strings
module Backgrounded
  module Resque
    class PseudoResqueHandler < Backgrounded::Handler::AbstractHandler
      def request(object, method, args)
        marshalled_args = ::Resque.decode(::Resque.encode(args))
        object.send method, *marshalled_args
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
backgrounded-resque-2.0.0.rc4 lib/backgrounded-resque/pseudo_resque_handler.rb
backgrounded-resque-2.0.0.rc3 lib/backgrounded-resque/pseudo_resque_handler.rb
backgrounded-resque-2.0.0.rc2 lib/backgrounded-resque/pseudo_resque_handler.rb