| 1564 | return cls(rebuilt_tasks, app=app, **d['options']) |
| 1565 | |
| 1566 | def __init__(self, *tasks, **options): |
| 1567 | if len(tasks) == 1: |
| 1568 | tasks = tasks[0] |
| 1569 | if isinstance(tasks, group): |
| 1570 | tasks = tasks.tasks |
| 1571 | if isinstance(tasks, abstract.CallableSignature): |
| 1572 | tasks = [tasks.clone()] |
| 1573 | if not isinstance(tasks, _regen): |
| 1574 | # May potentially cause slow downs when using a |
| 1575 | # generator of many tasks - Issue #6973 |
| 1576 | tasks = regen(tasks) |
| 1577 | super().__init__('celery.group', (), {'tasks': tasks}, **options |
| 1578 | ) |
| 1579 | self.subtask_type = 'group' |
| 1580 | |
| 1581 | def __call__(self, *partial_args, **options): |
| 1582 | return self.apply_async(partial_args, **options) |