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 May 04 03:45:39 -0700 2008
commit  d17537f77b905238d67182bb3de9e14cf57dfc0b
tree    391910f4132d2249c507af7a353d9c01ab34101a
parent  ce678cf9e0d91b2946ff4b330940daf4d7cf9890
erlang-beanstalk / README.txt
100644 74 lines (41 sloc) 1.632 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
================
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!
 
 
Who should I contact?
---------------------
 
Tim Fletcher (tfletcher.com).
 
 
Acknowledgements
----------------
 
Thanks to Dustin Sallings for introducing me to Emakefiles.