def apply_chord(self, header, partial_args, group_id, body, **options):
        u"""
        Instantiate a linking ChordData object before executing subtasks.

        Parameters
        ----------
            header: a list of incomplete subtask signatures, with partial
                different-per-instance arguments already set.
            partial_args: list of same-per-instance subtask arguments.
            group_id: a uuid that proved unnecessary in our approach. We use
                the callback's frozen TaskMeta id as a linking piece of data.
            body: the callback task signature, with all non-subtask-dependent
                arguments already set.

        Return value is the (unfinished) AsyncResult for body.

        """
        callback_entry = TaskMeta.objects.create(task_id=body.id)
        chord_data = ChordData.objects.create(callback_result=callback_entry)
        for subtask in header:
            subtask_entry = TaskMeta.objects.create(task_id=subtask.id)
            chord_data.completed_results.add(subtask_entry)
        if body.options.get(u'use_iterator', None) is None:
            body.options[u'use_iterator'] = True
        chord_data.serialized_callback = json.dumps(body)
        chord_data.save()

        return header(*partial_args, task_id=group_id)
def apply_chord ( self , header , partial_args , group_id , body , ** options ) : callback_entry = TaskMeta . objects . create ( task_id = body . id ) chord_data = ChordData . objects . create ( callback_result = callback_entry ) for subtask in header : subtask_entry = TaskMeta . objects . create ( task_id = subtask . id ) chord_data . completed_results . add ( subtask_entry ) if body . options . get ( u'use_iterator' , None ) is None : body . options [ u'use_iterator' ] = True chord_data . serialized_callback = json . dumps ( body ) chord_data . save ( ) return header ( * partial_args , task_id = group_id )
u"""
        Instantiate a linking ChordData object before executing subtasks.

        Parameters
        ----------
            header: a list of incomplete subtask signatures, with partial
                different-per-instance arguments already set.
            partial_args: list of same-per-instance subtask arguments.
            group_id: a uuid that proved unnecessary in our approach. We use
                the callback's frozen TaskMeta id as a linking piece of data.
            body: the callback task signature, with all non-subtask-dependent
                arguments already set.

        Return value is the (unfinished) AsyncResult for body.