Skip to content

Commit 1911786

Browse files
authored
Merge pull request #47 from cuda-networks/BNCASB-2204-cleanup-eb-sqs
BNCASB-2204: Initial changes to clean the project (removing group client and unused code)
2 parents 98787b0 + 2212d14 commit 1911786

File tree

15 files changed

+31
-483
lines changed

15 files changed

+31
-483
lines changed

README.md

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff 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
22

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.
44

55
### Installation
66

@@ -69,42 +69,13 @@ The retry call supports the `delay` and `execute_inline` arguments in order to d
6969

7070
#### Executing Tasks
7171

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.
73-
74-
```python
75-
urlpatterns = [
76-
...
77-
url(r'^worker/', include('eb_sqs.urls', namespace='eb_sqs'))
78-
]
79-
```
80-
81-
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.
86-
87-
```bash
88-
python manage.py run_eb_sqs_worker --url <absoulte endpoint url> --queue <queue-name>
89-
```
90-
91-
For example:
92-
93-
```bash
94-
python manage.py run_eb_sqs_worker --url http://127.0.0.1:80/worker/process --queue default
95-
```
96-
97-
#### Executing Tasks without Elastic Beanstalk
98-
99-
Another way of executing tasks is to use the Django command `process_queue`.
72+
In order to execute tasks, use the Django command `process_queue`.
10073
This command can work with one or more queues, reading from the queues infinitely and executing tasks as they come-in.
10174

10275
```bash
10376
python manage.py process_queue --queues <comma-delimited list of queue names>
10477
```
10578

106-
This is a good idea for someone who wants to execute tasks without an Elastic Beanstalk worker.
107-
10879
You can either use full queue names, or queue prefix using `prefix:*my_example_prefix*` notation.
10980

11081
Examples:
@@ -115,26 +86,6 @@ python manage.py process_queue --queues queue1,prefix:pr1-,queue2 # process queu
11586

11687
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.
11788

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-
def group_finished(group_id):
135-
pass
136-
```
137-
13889
#### Auto Tasks
13990

14091
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.

development.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ boto3==1.9.86
22
Django==1.10.6
33
mock==2.0.0
44
moto==1.3.13
5-
redis==2.10.5
6-
requests==2.10.0
5+
requests==2.10.0

eb_sqs/management/commands/run_eb_sqs_worker.py

Lines changed: 0 additions & 79 deletions
This file was deleted.

eb_sqs/redis/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

eb_sqs/redis/redis_group_client.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

eb_sqs/tests/tests_views.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)