README.markdown in resque-mongo-1.3.1 vs README.markdown in resque-mongo-1.4.0
- old
+ new
@@ -381,19 +381,25 @@
Resque workers respond to a few different signals:
* `QUIT` - Wait for child to finish processing then exit
* `TERM` / `INT` - Immediately kill child then exit
* `USR1` - Immediately kill child but don't exit
+* `USR2` - Don't start to process any new jobs
+* `CONT` - Start to process new jobs again after a USR2
If you want to gracefully shutdown a Resque worker, use `QUIT`.
If you want to kill a stale or stuck child, use `USR1`. Processing
will continue as normal unless the child was not found. In that case
Resque assumes the parent process is in a bad state and shuts down.
If you want to kill a stale or stuck child and shutdown, use `TERM`
+If you want to stop processing jobs, but want to leave the worker running
+(for example, to temporarily alleviate load), use `USR2` to stop processing,
+then `CONT` to start it again.
+
### Mysql::Error: MySQL server has gone away
If your workers remain idle for too long they may lose their MySQL
connection. If that happens we recommend using [this
Gist](http://gist.github.com/238999).
@@ -625,11 +631,11 @@
object. This means if you're already using Redis in your app, Resque
can re-use the existing connection.
String: `Resque.redis = 'localhost:6379'`
-Redis: `Redus.redis = $redis`
+Redis: `Resque.redis = $redis`
For our rails app we have a `config/initializers/resque.rb` file where
we load `config/resque.yml` by hand and set the Redis information
appropriately.
@@ -655,10 +661,29 @@
$ RAILS_ENV=production resque-web rails_root/config/initializers/resque.rb
Now everyone is on the same page.
+Namespaces
+----------
+
+If you're running multiple, separate instances of Resque you may want
+to namespace the keyspaces so they do not overlap. This is not unlike
+the approach taken by many memcached clients.
+
+This feature is provided by the [redis-namespace][rs] library, which
+Resque uses by default to separate the keys it manages from other keys
+in your Redis server.
+
+Simply use the `Resque.redis.namespace` accessor:
+
+ Resque.redis.namespace = "resque:GitHub"
+
+We recommend sticking this in your initializer somewhere after Redis
+is configured.
+
+
Demo
----
Resque ships with a demo Sinatra app for creating jobs that are later
processed in the background.
@@ -750,6 +775,6 @@
[0]: http://github.com/blog/542-introducing-resque
[1]: http://help.github.com/forking/
[2]: http://github.com/defunkt/resque/issues
[sv]: http://semver.org/
-[resque]: http://github.com/defunct/resque
+[rs]: http://github.com/defunkt/redis-namespace