Merge pull request #311 from selwin/gh-pages

Document custom worker classes.
This commit is contained in:
Vincent Driessen 2014-02-09 12:10:09 +01:00
commit 95df0e70e5
1 changed files with 19 additions and 0 deletions

View File

@ -163,3 +163,22 @@ To specify which module to read settings from, use the `-c` option:
{% highlight console %}
$ rqworker -c settings
{% endhighlight %}
## Custom worker classes
_New in version 0.4.0._
There are times when you want to customize the worker's behavior. Some of the
more common requests so far are:
1. Managing database connectivity prior to running a job.
2. Using a job execution model that does not require `os.fork`.
3. The ability use different concurrency models such as
`multiprocessing` or `gevent`.
You can use the `-w` option to specify a different worker class to use:
{% highlight console %}
$ rqworker -w 'path.to.GeventWorker'
{% endhighlight %}