mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-28 19:28:11 +08:00
docs: group functions for task instances
updated group example to reflect easier syntax.
This commit is contained in:
+2
-2
@@ -220,8 +220,8 @@ Adapted from `Sebastian Raschka's blog <http://sebastianraschka.com/Articles/201
|
||||
|
||||
# wait for 100 results to return and print it.
|
||||
def parzen_hook(task):
|
||||
if count_group('parzen') == 100:
|
||||
print(result_group('parzen'))
|
||||
if task.group_count() == 100:
|
||||
print(task.group_result())
|
||||
|
||||
|
||||
Django Q is not optimized for distributed computing, but this example will give you an idea of what you can do with task :ref:`groups`.
|
||||
|
||||
Reference in New Issue
Block a user