mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-09 04:08:12 +08:00
Updated README
This commit is contained in:
@@ -60,3 +60,4 @@ dev-requirements.txt
|
|||||||
manage.py
|
manage.py
|
||||||
testq
|
testq
|
||||||
db.sqlite3
|
db.sqlite3
|
||||||
|
.venv
|
||||||
@@ -9,11 +9,25 @@ Main focus will be put on creating tests now.
|
|||||||
### Architecture
|
### Architecture
|
||||||

|

|
||||||
|
|
||||||
|
### Usage
|
||||||
|
Schedule the asynchronous exectution of a function by calling `async` from within your Django project.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
async(func,*args,hook=None,**kwargs)
|
async(func,*args,hook=None,**kwargs)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Management commands
|
||||||
|
|
||||||
|
#### `qcluster`
|
||||||
|
Start a cluster with `./manage.py qcluster`
|
||||||
|
|
||||||
|
####`qmonitor`
|
||||||
|
You can monitor basic information about all the connected clusters by running `./manage.py qmonitor`
|
||||||
|
|
||||||
|
###Admin integration
|
||||||
|
Django Q registers itself with the admin page to show failed and succesful tasks.
|
||||||
|
From there task results can be read or deleted. If neccesary, failed tasks can be reintroduced to the queue.
|
||||||
|
|
||||||
### Signed Tasks
|
### Signed Tasks
|
||||||
Tasks are first pickled to Json and then signed using Django's own signing module before being sent to a Redis list. This ensures that task packages on the Redis server can only be excuted and read by clusters and django servers who share the same secret key.
|
Tasks are first pickled to Json and then signed using Django's own signing module before being sent to a Redis list. This ensures that task packages on the Redis server can only be excuted and read by clusters and django servers who share the same secret key.
|
||||||
|
|
||||||
@@ -45,12 +59,5 @@ In case of a stop signal, the sentinel will halt the pusher and instruct the wor
|
|||||||
|
|
||||||
Packages can be assigned a hook function, upon completion of the package this function will be called with the Task object as the first argument.
|
Packages can be assigned a hook function, upon completion of the package this function will be called with the Task object as the first argument.
|
||||||
|
|
||||||
### Management command
|
|
||||||
Start the cluster with `./manage.py qcluster`
|
|
||||||
|
|
||||||
###Admin integration
|
|
||||||
Django Q registers itself with the admin page to show failed and succesful tasks.
|
|
||||||
From there task results can be read or deleted. If neccesary, failed tasks can be reintroduced to the queue.
|
|
||||||
|
|
||||||
### Todo
|
### Todo
|
||||||
I'll add to this README while I'm developing the various parts.
|
I'll add to this README while I'm developing the various parts.
|
||||||
+27
-12
@@ -18,10 +18,37 @@ Architecture
|
|||||||
:alt: Django Q schema
|
:alt: Django Q schema
|
||||||
|
|
||||||
Django Q schema
|
Django Q schema
|
||||||
|
Usage
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
Schedule the asynchronous exectution of a function by calling ``async``
|
||||||
|
from within your Django project.
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
async(func,*args,hook=None,**kwargs)
|
async(func,*args,hook=None,**kwargs)
|
||||||
|
|
||||||
|
Management commands
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
``qcluster``
|
||||||
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Start a cluster with ``./manage.py qcluster``
|
||||||
|
|
||||||
|
``qmonitor``
|
||||||
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
|
You can monitor basic information about all the connected clusters by
|
||||||
|
running ``./manage.py qmonitor``
|
||||||
|
|
||||||
|
Admin integration
|
||||||
|
~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Django Q registers itself with the admin page to show failed and
|
||||||
|
succesful tasks. From there task results can be read or deleted. If
|
||||||
|
neccesary, failed tasks can be reintroduced to the queue.
|
||||||
|
|
||||||
Signed Tasks
|
Signed Tasks
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
@@ -77,18 +104,6 @@ Hooks
|
|||||||
Packages can be assigned a hook function, upon completion of the package
|
Packages can be assigned a hook function, upon completion of the package
|
||||||
this function will be called with the Task object as the first argument.
|
this function will be called with the Task object as the first argument.
|
||||||
|
|
||||||
Management command
|
|
||||||
~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Start the cluster with ``./manage.py qcluster``
|
|
||||||
|
|
||||||
Admin integration
|
|
||||||
~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Django Q registers itself with the admin page to show failed and
|
|
||||||
succesful tasks. From there task results can be read or deleted. If
|
|
||||||
neccesary, failed tasks can be reintroduced to the queue.
|
|
||||||
|
|
||||||
Todo
|
Todo
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user