Sha256: 9a7f63a4a3196fefd242a2de7305598ae06fa8fa16e54c4822b9e3e2b38821d7

Contents?: true

Size: 501 Bytes

Versions: 1

Compression:

Stored size: 501 Bytes

Contents

require 'resque'

# 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
      def request(object, method, args, options={})
        marshalled_args = ::Resque.decode(::Resque.encode(args))
        object.send method, *marshalled_args
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
backgrounded-resque-2.0.0 lib/backgrounded-resque/pseudo_resque_handler.rb