René's URL Explorer Experiment


Title: [Async stack 2/6] asyncio composition by andystaples · Pull Request #359 · microsoft/durabletask-python · GitHub

Open Graph Title: [Async stack 2/6] asyncio composition by andystaples · Pull Request #359 · microsoft/durabletask-python

X Title: [Async stack 2/6] asyncio composition by andystaples · Pull Request #359 · microsoft/durabletask-python

Description: WarningDo not merge this PR, or any other PR in this stack, on its own. The stack exists only to make review easier. Once every PR in the stack is approved, the whole stack will be squash-merged together. Part of the reviewability stack split from #293. This PR is based on the coroutine-dispatch layer (#357). Scope This PR extends the deterministic orchestration event loop in durabletask/internal/asyncio_loop.py. It adds support for standard asyncio composition primitives inside async orchestrators: Tasks: create_task returns a _DurableAsyncTask that is retired when it completes, so finished tasks and their payloads are released. Deterministic ready queue: call_soon keeps FIFO order. While a task is being cancelled, callbacks scheduled during that cancellation are ordered deterministically. This keeps TaskGroup cancellation, and the durable actions it produces, stable across replays. Durable timers: call_later and call_at are backed by durable timers through _DurableTimerHandle. Non-finite delays are rejected. Past deadlines go straight to the ready queue. Deadlines are rounded up to the timer resolution so a callback never fires early. Cancelling a handle also cancels its durable timer. Handles are compared by identity, so identical callbacks scheduled at the same time stay independent. As a result, asyncio.sleep, asyncio.wait_for, asyncio.timeout, asyncio.gather, and asyncio.TaskGroup work inside async orchestrators. Review focus Ordering rules for call_soon versus cancellation callbacks, and the durable actions they produce. Deadline rounding, and how cancelling a timer handle interacts with its durable timer. Whether local task cancellation stops a waiter without cancelling durable work that other waiters still share. Deferred to later layers Dispatch teardown: closing the loop, async-generator finalization, the cleanup-error policy, and guards for unsupported I/O and executors. Cold context: the AsyncOrchestrationContext API surface. Azure Functions integration and release notes. The tests in this layer use the existing OrchestrationContext APIs. Later layers move them to the async context.

Open Graph Description: WarningDo not merge this PR, or any other PR in this stack, on its own. The stack exists only to make review easier. Once every PR in the stack is approved, the whole stack will be squash-merged to...

X Description: WarningDo not merge this PR, or any other PR in this stack, on its own. The stack exists only to make review easier. Once every PR in the stack is approved, the whole stack will be squash-merged to...

Opengraph URL: https://github.com/microsoft/durabletask-python/pull/359

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9525566b-7e5c-525b-b759-451f60241189
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDA82:3804E:60D53:7E7E5:6AFE2D0D
html-safe-nonce6c5bcaa31a995f5f5f5d0e576625391bc8f9fabeb6d8bc4b9699ba064fcd995f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTgyOjM4MDRFOjYwRDUzOjdFN0U1OjZBRkUyRDBEIiwidmlzaXRvcl9pZCI6IjczMDIwMTQ0ODg4ODkxNDI1NDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac04fc0bf339eded600a8a4e3a313a3fef3bef3d77caacb43abd5c3c66d4b27db1
hovercard-subject-tagpull_request:5265842921
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/microsoft/durabletask-python/pull/359/files
twitter:imagehttps://avatars.githubusercontent.com/u/77818326?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/77818326?s=400&v=4
og:image:altWarningDo not merge this PR, or any other PR in this stack, on its own. The stack exists only to make review easier. Once every PR in the stack is approved, the whole stack will be squash-merged to...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonee973f9ec3625f3faad8cac5c2d11a214b7ffe45f3cc563b828459b290ecaeed3
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/microsoft/durabletask-python git https://github.com/microsoft/durabletask-python.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id627664515
octolytics-dimension-repository_nwomicrosoft/durabletask-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id627664515
octolytics-dimension-repository_network_root_nwomicrosoft/durabletask-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1f92c367595b9190e0be293896078033886b1913
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/microsoft/durabletask-python/pull/359/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fdurabletask-python%2Fpull%2F359%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fdurabletask-python%2Fpull%2F359%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=microsoft%2Fdurabletask-python
Reloadhttps://github.com/microsoft/durabletask-python/pull/359/files
Reloadhttps://github.com/microsoft/durabletask-python/pull/359/files
Reloadhttps://github.com/microsoft/durabletask-python/pull/359/files
microsofthttps://github.com/microsoft
durabletask-pythonhttps://github.com/microsoft/durabletask-python
Codehttps://github.com/microsoft/durabletask-python
Issues15 (15)https://github.com/microsoft/durabletask-python/issues
Pull requests12 (12)https://github.com/microsoft/durabletask-python/pulls
Actionshttps://github.com/microsoft/durabletask-python/actions
Projectshttps://github.com/microsoft/durabletask-python/projects
Security and qualityhttps://github.com/microsoft/durabletask-python/security
Insightshttps://github.com/microsoft/durabletask-python/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fmicrosoft%2Fdurabletask-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fmicrosoft%2Fdurabletask-python%2Fissues%2Fnew%2Fchoose
andystapleshttps://github.com/andystaples
andystaples-async-stack-1-coroutine-dispatchhttps://github.com/microsoft/durabletask-python/tree/andystaples-async-stack-1-coroutine-dispatch
andystaples-async-stack-2-asyncio-composition-46bhttps://github.com/microsoft/durabletask-python/tree/andystaples-async-stack-2-asyncio-composition-46b
Conversation 1 https://github.com/microsoft/durabletask-python/pull/359
Commits 1 https://github.com/microsoft/durabletask-python/pull/359/commits
Checks 1 https://github.com/microsoft/durabletask-python/pull/359/checks
Files changed https://github.com/microsoft/durabletask-python/pull/359/files
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/359/files
[Async stack 2/6] asyncio composition https://github.com/microsoft/durabletask-python/pull/359/files#top
Show all changes 1 commit https://github.com/microsoft/durabletask-python/pull/359/files
39d4187 Add deterministic asyncio composition for async orchestrators andystaples Nov 11, 2026 https://github.com/microsoft/durabletask-python/pull/359/commits/39d41871b196eb28f7ea1bf07b981e6bf64ffd9f
Clear filters https://github.com/microsoft/durabletask-python/pull/359/files
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/359/files
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/359/files
asyncio_loop.py https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
test_asyncio_orchestrators.py https://github.com/microsoft/durabletask-python/pull/359/files#diff-3f4f24b2fcba2e5d488f7876e8ad325f8de6a46896d88007d62be7f4bf3c9484
durabletask/internal/asyncio_loop.pyhttps://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
View file https://github.com/microsoft/durabletask-python/blob/39d41871b196eb28f7ea1bf07b981e6bf64ffd9f/durabletask/internal/asyncio_loop.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/microsoft/durabletask-python/pull/359/{{ revealButtonHref }}
https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
https://github.com/microsoft/durabletask-python/pull/359/files#diff-b47a297d48291ca48ccaeff82a094c93788a41cc7077d83021f9a477bbb95407
Please reload this pagehttps://github.com/microsoft/durabletask-python/pull/359/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.