README.rdoc in em-beanstalk-0.0.3 vs README.rdoc in em-beanstalk-0.0.4
- old
+ new
@@ -1,11 +1,12 @@
-= EMJack
+= EM::Beanstalk
An attempt to wrap portions of the Beanstalk protocol with EventMachine. Every command
-will return a deferrable object. That object will succeed or fail depending on the
-reply returned from Beanstalk.
+will return a deferrable object. As well, every command can accept a block with will
+be used as the succeed callback for each command. That object will succeed or fail
+depending on the reply returned from Beanstalk.
-The current, default, errback is to print the error message received.
+The default errback is to print the error message received.
One thing to keep in mind. The Beanstalk protocol executes all commands serially.
So, if you send a reserve command and there are no jobs Beanstalk _won't_ process
any of the commands that come after the reserve until the reserve completes.
@@ -17,11 +18,11 @@
- RSpec (to run the tests)
- EM::Spec
= Examples
EM.run {
- jack = EMJack::Connection.new
+ jack = EM::Beanstalk.new
jack.use('mytube') { |tube| puts "Using #{tube}" }
jack.reserve do |job|
puts job.id
@@ -38,18 +39,18 @@
jack.list(:tubes) { |tubes| puts "There are #{tubes.length} tubes defined" }
}
- EMJack#each_job is useful for scenarios where the client is a job worker
+ EM::Beanstalk#each_job is useful for scenarios where the client is a job worker
and intended to process jobs continuously as they become available. Once
the queue is empty, the client will block and wait for a new job.
If multiple workers connect to the queue Beanstalkd will round-robin between
the workers.
EM.run {
- jack = EMJack::Connection.new
+ jack = EM::Beanstalk.new
jack.each_job do |job|
puts "Got job ##{job.id}: #{job}"
if process(job)
@@ -61,13 +62,5 @@
def process(job)
# Some kind of job processing
end
}
-
-
-= Contact
-If you've got any questions, comments or bugs, please let me know. You can
-contact me by email at dj2 at everburning dot com.
-
-= Contributors
-Peter Kieltyka (EMJack#each_job)