https://github.com/wichert/pyramid_rq
Support using the rq queueing system with pyramid
https://github.com/wichert/pyramid_rq
Last synced: 7 months ago
JSON representation
Support using the rq queueing system with pyramid
- Host: GitHub
- URL: https://github.com/wichert/pyramid_rq
- Owner: wichert
- License: other
- Archived: true
- Created: 2012-05-04T12:48:11.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2016-06-30T08:46:58.000Z (almost 10 years ago)
- Last Synced: 2024-04-10T05:00:55.822Z (about 2 years ago)
- Language: Python
- Size: 137 KB
- Stars: 9
- Watchers: 0
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-pyramid - pyramid_rq - Support using the rq (Task Queue)
README
Integration rq with pyramid
===========================
This package makes it possible to use the `RQ `_
job queueing library in `Pyramid
`_ applications.
Specifically it does three things:
1. allow configuring the redis connection in your ``.ini``-file
2. make sure the redis connection used by RQ is appropriate for the
Pyramid application, even if you are running multiple differently
configure Pyramid applications within the same process.
3. provide a replacement for the standard RQ worker which runs all
tasks in a fully configured Pyramid environment.
How to use pyramid_rq
=====================
Using pyramid_rq is very easy. The first thing you need to do is add
``pyramid_rq`` to the list of required packages in your ``setup.py``
file::
setup(name='my_package',
...
install_requires=['pyramid_rq'],
...
)
After doing this you will need to reinstall/develop your application or, if
you are using buildout, rerun buildout.
The next step is to configure RQ in your application. In your startup code
simply add this line::
config.include('pyramid_rq')
And that is everything! This will setup a default configuration that
assumes you are using a local redis server.
Configuration
=============
The default configuration assumes that you are using a local redis server
listening on its default port. If your environment is different you can
specify a different configuration in your ``.ini``-file. This is done using
three options:
``rq.redis.host`` or ``redis.host``
The hostname for the redis server. If not specified defaults to
``localhost``.
``rq.redis.port`` or ``redis.port``
The TCP port used to connect to the redis server. Defaults to 6379.
``rq.redis.db`` or ``redis.db``
The redis database nmber to use. If not specified this defaults to 1.
All configuration options are available under two keys: either prefixed
by ``rq.redis`` or by ``redis``, prefering the ``rq.redis`` key if
present. This is done to allow using the redis configuration in other
places as well, while also making it possible to use a different redis
configuration for RQ.