From 5c4d3bf90194ee7b1e53a49f358ea78c7ce23e75 Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Thu, 5 Sep 2013 13:51:04 -0700 Subject: [PATCH 1/2] document worker features --- readme.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 495e74a8..a8f5f44c 100644 --- a/readme.md +++ b/readme.md @@ -9,8 +9,8 @@ Features: * Leverage of PostgreSQL's listen/notify & row locking. * Support for multiple queues with heterogeneous workers. * JSON data format. -* Forking workers. -* [Fuzzy-FIFO support](http://www.cs.tau.ac.il/~shanir/nir-pubs-web/Papers/Lock_Free.pdf). +* Concurrent job processing using forking workers. +* [Reduced contention FIFO design](http://www.cs.tau.ac.il/~shanir/nir-pubs-web/Papers/Lock_Free.pdf). Contents: @@ -56,7 +56,12 @@ p_queue.enqueue("Kernel.puts", ["hello", "world"]) ### Working Jobs -There are two ways to work jobs. The first approach is to use the Rake task. The second approach is to use a custom executable. +There are two ways to work jobs. The first approach is to use the Rake task. The second approach is to use a custom executable. Each approach provides a set of configuration options accessable through the processes' environment: + +* `$CONCURRENCY=1` - The number of child processes to run concurrently. +* `$FORK_WORKER=false` - Fork on each job execution. Enabled if `$CONCURRENCY` > 1 +* `$QUEUE=default` - The name of the queue to process. +* `$TOP_BOUND=9` - The section of the queue that is elgible for dequeue operations. Setting this value to 1 will ensure a strict FIFO ordering. #### Rake Task @@ -74,10 +79,10 @@ Start the worker via the Rakefile. $ bundle exec rake qc:work ``` -Setup a worker to work a non-default queue. +Setup a worker to work a non-default queue while processing 4 jobs at a time. ```bash -$ QUEUE="priority_queue" bundle exec rake qc:work +$ CONCURRENCY=4 QUEUE="priority_queue" bundle exec rake qc:work ``` #### Custom Worker From f314b7e338237e8fcd92c6d69b472cb14f2cd4f2 Mon Sep 17 00:00:00 2001 From: Ryan Smith Date: Thu, 5 Sep 2013 13:51:53 -0700 Subject: [PATCH 2/2] update gemfile for 2.3.0beta --- queue_classic.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queue_classic.gemspec b/queue_classic.gemspec index 6fc7b1fe..3a29180c 100644 --- a/queue_classic.gemspec +++ b/queue_classic.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |s| s.name = "queue_classic" s.email = "ryan@heroku.com" - s.version = "2.2.1" + s.version = "2.3.0beta" s.date = "2013-01-02" s.description = "queue_classic is a queueing library for Ruby apps. (Rails, Sinatra, Etc...) queue_classic features asynchronous job polling, database maintained locks and no ridiculous dependencies. As a matter of fact, queue_classic only requires pg." s.summary = "postgres backed queue"