Skip to content

Commit 2dec0ba

Browse files
docs: mention that tasks need to be imported
1 parent f0f9506 commit 2dec0ba

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
CHANGES
22
=======
33

4+
2.11.0
5+
------
6+
7+
* release(2.11.0): add ptq purge and support ptq status for SQS
8+
* feat: add purge command to cli, add status support to SQS
9+
* docs: update ptq on README
10+
411
2.10.0
512
------
613

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,12 @@ class PrintTask(RegisteredTask):
6363

6464
## Local Usage
6565

66-
For small jobs, you might want to use one or more processes to execute the tasks:
66+
For small jobs, you might want to use one or more processes to execute the tasks.
6767

6868
```python
6969
from functools import partial
7070
from taskqueue import LocalTaskQueue
71+
from mylibrary import PrintTask # mylibrary is wherever you defined PrintTask
7172

7273
tq = LocalTaskQueue(parallel=5) # use 5 processes
7374

@@ -94,10 +95,13 @@ This will load the queue with 1000 print tasks then execute them across five pro
9495

9596
2. You can alternatively set up a file based queue that has the same time-based leasing property of an SQS queue.
9697

98+
IMPORTANT: You must import the tasks that will be executed, otherwise the code to execute them has not been loaded.
99+
97100
```python
98101
# import gevent.monkey
99102
# gevent.monkey.patch_all(thread=False)
100103
from taskqueue import TaskQueue
104+
from mylibrary import PrintTask # mylibrary is wherever you defined PrintTask
101105

102106
# region is SQS specific, green means cooperative threading
103107
tq = TaskQueue('sqs://queue-name', region_name="us-east1-b", green=False)

0 commit comments

Comments
 (0)