# Path: tests/examples/user_code/worker.py
# @app.task
# def function_aggregate(*args, **kwargs):
#     return dict(input=args, extra=kwargs)
# 
# @app.task(bind=True, max_retries=2)
# def function_test(self, retries, **kwargs):
#     if retries > self.request.retries:
#         raise self.retry(countdown=1)
#     return kwargs.get('result', 'this is the result')


import time
from celery import chord, group
from .worker import function_aggregate, function_test



chord(
    group(function_test.s(0, value=i) for i in range(1000)),
    function_aggregate.s(from_chord=True)

# Path: tests/examples/user_code/worker.py
# @app.task
# def function_aggregate(*args, **kwargs):
#     return dict(input=args, extra=kwargs)
# 
# @app.task(bind=True, max_retries=2)
# def function_test(self, retries, **kwargs):
#     if retries > self.request.retries:
#         raise self.retry(countdown=1)
#     return kwargs.get('result', 'this is the result')


# Path: tests/examples/user_code/publisher_group.py
import time
from celery import chord, group
from .worker import function_aggregate, function_test




chord(
    group(function_test.s(0, value=i) for i in range(1000)),
    function_aggregate.s(from_chord=True)

)()