public
Description: An Erlang client library for beanstalkd
Homepage: http://tfletcher.com/dev/erlang-beanstalk
Clone URL: git://github.com/tim/erlang-beanstalk.git
tim (author)
Sun Apr 27 03:00:11 -0700 2008
commit  88b25b134fe3178209246fb47cdd007656306c46
tree    3d0ceb0d856a8cb1393849f0349b0e06663291a5
parent  4e657c5f52d29cc17aced32777707051ac15e6cb
name age message
file .gitignore Sun Apr 27 02:19:24 -0700 2008 First commit. [tim]
file README.txt Sun Apr 27 03:00:11 -0700 2008 Deleting with a job ID is probably more intuitive. [tim]
directory src/ Sun Apr 27 02:39:56 -0700 2008 No idea why I thought get_value was called fetch. [tim]
README.txt
================
Erlang-Beanstalk
================


What is this?
-------------

An Erlang module that wraps the beanstalkd protocol.


What is beanstalkd?
-------------------

A fast, distributed, in-memory workqueue service.

See http://xph.us/software/beanstalkd/ for more information,
and links to clients in other languages.


How do I use it?
----------------

First, make sure both of the modules are compiled, and that you
have an instance of beanstalkd running in the background. Then
you can connect to it like so (using whatever host and port values
are appropriate for you):

  {ok, Socket} = beanstalk:connect(_Host="0.0.0.0", _Port=3000).

At the moment this is just a direct call to gen_tcp:connect/3.

Jobs are manipulated using the beanstalk_job module. To create
a new job, pass a string or a binary to beanstalk_job:new/1:

  Job = beanstalk_job:new("hello").

You can alter the defaults using beanstalk_job:with/3, e.g.,

  DelayedJob = beanstalk_job:with(delay, 30, Job).

All the functions in the beanstalk module (apart from connect/2)
correspond to calls in the beanstalkd protocol. Each expects to
be given the socket connection as the last argument. For example:

  {inserted, JobID} = beanstalk:put(Job, Socket).

  {reserved, Job} = beanstalk:reserve(Socket).

  deleted = beanstalk:delete(JobID, Socket).

And so on.


WTF?
----

Found a bug? Think I could have done something better?

Don't let it trouble you :) Let me know!