Sha256: a07d8b85cbe89484ffb92e5452b29a6414232cd64cff8ccf4881e5e4e0fc2a37

Contents?: true

Size: 655 Bytes

Versions: 1

Compression:

Stored size: 655 Bytes

Contents

require 'job_fu'

module Backgrounded
  module Handler
    # invoke the operation in the background using job fu
    # see http://github.com/jnstq/job_fu/tree
    class JobFuHandler
      # ==== Parameters
      # Optional argment hash will be picked up by the request method
      #
      # * <tt>:priority</tt> - priority for the job
      # * <tt>:at</tt> - when the job should run
      #
      def request(object, method, *args)
        opt = args.extract_options!
        priority, process_at = opt[:priority], opt[:at]
        JobFu::Job.enqueue JobFu::ProcessableMethod.new(object, method, *args), priority, process_at
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wireframe-backgrounded-0.3.0 lib/handler/job_fu_handler.rb