Plugin::Resque

Integrates Resque Worker and Job functionality into LanGrove. Resque uses Redis under the hood.

gem install langrove-plugin-resque

Implements

  • Adaptor::ResqueAdaptor < LanGrove::Adaptor::Base ...the worker (de-queue-er)
  • Handler::ResqueHandler < LanGrove::Handler::Base ...the job
  • Plugin::ResqueQueue < LanGrove::Plugin::Enqueuer ...the en-queue-er

Supports

  • LanGrove::Behaviour::Enqueueable

Important

  • Departs form traditional Resqu use.
  • Each queue has a corresponding queue_failed queue.
  • Uncaught exceptions from the Job are caught in the Worker and posted onto the _failed queue along with the original payload.
  • There is no infrastructure to resubmit.

Examples

Configure a Daemon to post jobs onto a queue.



  ...

    :plugins:
        :a_job_queue:
            :class: ResqueQueue
            :job: JobName
            :queue: job_name

            #
            # Optionals (with defaults)
            # 
            # Refers to the redis connection
            # 
            :hostname: localhost
            :port: 6397

  ...

    :server:
        :behavior:
            :enqueueable:
                :plugin: :a_job_queue
                :at:
                    :handler_after_receive: :enqueue_capsule
                    #
                    # will post the caspsule as payload
                    # onto the specified resque queue 
                    # after the Handler.receive( data )
                    # method returns.
                    #

    ...

Configure a Daemon to perform jobs from a queue.



    ...

    :adaptor:
        :class: ResqueAdaptor
        :plugin: :a_job_queue

    ...

    :handler:
        :class: JobName
        #
        # Should extend Handler::ResqueHandler
        #  

    ...

Change Log

2012-07-29

  • Added support for sharing common plugin subconfig branch
  • Added support for remote redis server.

2012-07-31

  • Deferrable was renamed to enqueueable
  • v0.3