Adds an output to the current Task, or if no task is active, create a dummy task that returns the given blob or record to the client. This will return the value of the blob or record when the last task of the TaskGroup for a given node finishes.
(blob_or_record)
| 399 | |
| 400 | |
| 401 | def final_output(blob_or_record): |
| 402 | """ |
| 403 | Adds an output to the current Task, or if no task is active, |
| 404 | create a dummy task that returns the given blob or record |
| 405 | to the client. This will return the value of the blob or record when |
| 406 | the last task of the TaskGroup for a given node finishes. |
| 407 | """ |
| 408 | cur_task = Task.current(required=False) or Task() |
| 409 | return cur_task.add_output(blob_or_record) |
| 410 | |
| 411 | |
| 412 | class TaskOutputList: |
searching dependent graphs…