Repository navigation
[Async stack 1/6] Coroutine dispatch - #357
Draft
andystaples wants to merge 4 commits into
Draft
andystaples wants to merge 4 commits into
andystaples wants to merge 4 commits into
Conversation
This was referenced Nov 11, 2026
andystaples
force-pushed
the
andystaples-async-stack-1-coroutine-dispatch
branch
from
November 12, 2026 16:48
e01cc4a to
1c76780
Compare
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Track identities across wrapped, partial, and callable nodes; recognize intermediate coroutine functions before following their wrapped targets. Cover bounded worker failures and nested decorated dispatch. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
andystaples
force-pushed
the
andystaples-async-stack-1-coroutine-dispatch
branch
from
November 12, 2026 20:23
1c76780 to
e73a705
Compare
…stack-1-coroutine-dispatch Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Check each callable before following functools.wraps metadata so generator wrappers of async functions stay synchronous, and classify once when the orchestrator is registered so wrapper cycles fail at registration. Normalize timezone-aware orchestration clocks in loop.time(), give loop timers an actionable error, document the private asyncio APIs the loop depends on, and add a generator history replay compatibility test. Remove the changelog entry for unreleased behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Do not merge this PR, or any other PR in the stack, on its own. The whole stack will be squash-merged once every PR in it is approved.
Layer 1/6 of the async orchestrator stack, which splits the closed #293 for review. It is based on #356.
Scope
shared.is_async_callableclassifies orchestrator callables. Each callable is checked directly first: coroutine functions are async and generator functions are synchronous, even when they carryfunctools.wrapsmetadata from a function of the other kind. Partials and callable objects resolve throughfuncand__call__; only a callable that is neither falls back to the function it wraps. Cyclic__wrapped__chains are reported as errors.functools.wraps. If it returned a generator, that generator is closed.Taskare rejected.DurableEventLoop(durabletask/internal/asyncio_loop.py). This loop is enough to:loop.time()is derived from the replay-safe orchestration clock (naive or timezone-aware). Loop timers, includingasyncio.sleep()with a positive delay, fail with an error that points toctx.create_timer(...)until [Async stack 2/6] asyncio composition and durable timers #358 adds durable loop timers.asyncio_loop.pylists each private asyncio API the loop depends on and why.Task.__await__andTask.wait()are now concrete. Inside the durable loop, awaiting suspends on the durable task. With no running loop,__await__yields the task itself so mock-based drivers can send results. Under a different running event loop, it raisesRuntimeError.SyncOrchestrator,AsyncOrchestrator, andOrchestratoraliases.Temporary differences (resolved in later layers)
OrchestrationContext, andAsyncOrchestratoris typed against it. Layer 4/6 ([Async stack 4/6] Add cold async orchestration context #361) adds the coldAsyncOrchestrationContext, its tests, and the context API and metadata parity tests.asyncio.sleepwith a positive delay, TaskGroup ordering) and the executor and thread guards come in layer 2/6 ([Async stack 2/6] asyncio composition and durable timers #358).