首先 好东西
http://kr.github.com/beanstalkd/
其次 真的是好东西 支持 java , python ,perl,ruby,erlang 和我不知道的 语言
官方的原文介绍:
$ ./beanstalkd -d -l 10.0.1.5 -p 11300
This starts up beanstalkd
as a daemon listening on address 10.0.1.5, port 11300.
Use It
Here’s an example in Ruby (see the client libraries to find your favorite language).
First, have one process put a job into the queue:
beanstalk = Beanstalk::Pool.new(['10.0.1.5:11300'])
beanstalk.put('hello')
Then start another process to take jobs out of the queue and run them:
beanstalk = Beanstalk::Pool.new(['10.0.1.5:11300'])
loop do
job = beanstalk.reserve
puts job.body # prints "hello"
job.delete
end
Thanks
Many thanks to memcached
for providing inspiration for simple protocol design and for the
structure of the documentation. Not to mention a fantastic piece of
software!
整理 www.blogjava.net/Good-Game