Skip to content

Make argument waiting recursive#133

Merged
joefreeman merged 1 commit intomainfrom
recursive-wait
Mar 7, 2026
Merged

Make argument waiting recursive#133
joefreeman merged 1 commit intomainfrom
recursive-wait

Conversation

@joefreeman
Copy link
Collaborator

@joefreeman joefreeman commented Mar 7, 2026

This updates 'waiting' to be recursive.

For example:

@cf.task()
def slow(x: int) -> int:
    time.sleep(10)
    return x

@cf.task()
def wrap(x: int) -> cf.Execution[int]:
    return slow.submit(x)

@cf.task(wait=True)
def unwrap(a: cf.Execution[cf.Execution[int]]) -> int:
    return a.result()

@cf.workflow()
def example():
    return unwrap.submit(wrap.submit(5))

Previously unwrap would have been called once wrap had completed. Now the orchestrator will wait for slow to have completed as well.

@joefreeman joefreeman merged commit 122d8cf into main Mar 7, 2026
9 checks passed
@joefreeman joefreeman deleted the recursive-wait branch March 7, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant