File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 11CHANGES
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+
4112.10.0
512------
613
Original file line number Diff line number Diff 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
6969from functools import partial
7070from taskqueue import LocalTaskQueue
71+ from mylibrary import PrintTask # mylibrary is wherever you defined PrintTask
7172
7273tq = 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
95962 . 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)
100103from taskqueue import TaskQueue
104+ from mylibrary import PrintTask # mylibrary is wherever you defined PrintTask
101105
102106# region is SQS specific, green means cooperative threading
103107tq = TaskQueue(' sqs://queue-name' , region_name = " us-east1-b" , green = False )
You can’t perform that action at this time.
0 commit comments