Beanstalk Farmer
Farmer is a simple library that helps you manage your Beanstalk job queue. Its
API is heavily inspired by Stalker, to help
you get done as quickly as possible, but whilst allowing you to use plain old
Ruby classes to ensure testability.
Setting up Jobs
Jobs are handled by any object whose instances respond to a #call
method, à
la Rack (e.g. Proc
s, procs
s). The payload of the job will be passed into
the arguments of this method. Bear in mind that the payload for a Beanstalk job
is de-serialized JSON.
By default all jobs will be deleted from the Beanstalk queue once completed.
This can be configured and changed by returning an Array of arguments from the
#call
method. The first argument is expected to be the name of the method you
wish to invoke on a job (see Beanstalk::Job
). All remaining arguments will be
passed to the named method.
For usage examples, see the examples directory in the source code.
Development
Shout Outs
Many thanks to nulayer.