You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-52Lines changed: 3 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
## Django EB SQS - Background Tasks for Elastic Beanstalk and Amazon SQS
1
+
## Django EB SQS - Background Tasks for Amazon SQS
2
2
3
-
django-eb-sqs is a simple task manager for the Elastic Beanstalk Worker Tier. It uses SQS and the [boto3](https://github.com/boto/boto3) library.
3
+
django-eb-sqs is a simple task manager for AWS SQS. It uses SQS and the [boto3](https://github.com/boto/boto3) library.
4
4
5
5
### Installation
6
6
@@ -69,42 +69,13 @@ The retry call supports the `delay` and `execute_inline` arguments in order to d
69
69
70
70
#### Executing Tasks
71
71
72
-
The Elastic Beanstalk Worker Tier sends all tasks to a API endpoint. django-eb-sqs has already such an endpoint which can be used by specifying the url mapping in your `urls.py` file.
In that case the relative endpoint url would be: `worker/process`
82
-
83
-
Set this url in the Elastic Beanstalk Worker settings prior to deployment.
84
-
85
-
During development you can use the included Django command to execute a small script which retrieves messages from SQS and posts them to this endpoint.
Use the signals `MESSAGES_RECEIVED`, `MESSAGES_PROCESSED`, `MESSAGES_DELETED` of the `WorkerService` to get informed about the current SQS batch being processed by the management command.
117
88
118
-
#### Group Tasks
119
-
Multiple tasks can be grouped by specifying the `group_id` argument when calling `delay` on a task.
120
-
If all tasks of a specific group are executed then the group callback task specified by `EB_SQS_GROUP_CALLBACK_TASK` is executed.
121
-
122
-
Example calls:
123
-
```python
124
-
echo.delay(message='Hello World!', group_id='1')
125
-
echo.delay(message='Hallo Welt!', group_id='1')
126
-
echo.delay(message='Hola mundo!', group_id='1')
127
-
```
128
-
129
-
Example callback which is executed when all three tasks are finished:
130
-
```python
131
-
from eb_sqs.decorators import task
132
-
133
-
@task(queue_name='test', max_retries=5)
134
-
defgroup_finished(group_id):
135
-
pass
136
-
```
137
-
138
89
#### Auto Tasks
139
90
140
91
This is a helper tool for the case you wish to define one of your class method as a task, and make it seamless to all callers.
0 commit comments