Skip to content

feat: add owned runtime and synchronous payment transport - #190

Draft
parvahuja wants to merge 1 commit into
parv/runtime-async-http-v0.12from
parv/sync-payment-transport-v0.13
Draft

feat: add owned runtime and synchronous payment transport#190
parvahuja wants to merge 1 commit into
parv/runtime-async-http-v0.12from
parv/sync-payment-transport-v0.13

Conversation

@parvahuja

@parvahuja parvahuja commented Jul 28, 2026

Copy link
Copy Markdown
Member

Runtime stack 3 of 5 · depends on #189 · next: #191

Summary

  • add OwnedPaymentRuntime with one explicitly owned asyncio loop
  • initialize and close managed method factories on that same loop
  • expose sync/async lifecycle contexts and sync credential/event calls
  • add SyncPaymentTransport with the same safety policy as the async transport
  • share credentialed-response settlement between the sync and async transports

Why the synchronization remains

AnyIO owns the portal, loop thread, task submission, and managed async-context lifecycle. pympp keeps one condition for single-use lifecycle and active leases, plus futures for non-blocking async callers. Cancellation accounting, early sync claims, and conditional orphan cleanup each cover a reproduced portal-leak or close race. No Python thread or executor APIs are patched.

Review boundary

Owned-loop lifecycle and low-level sync HTTP only. No per-client or global HTTPX patching and no MCP changes.

Validation

  • full suite: 899 passed, 41 skipped
  • deterministic repeated-cancel, concurrent start/ledger, shutdown, factory-failure, and factory-reentry probes
  • Ruff, formatting, and Pyright pass

@parvahuja
parvahuja force-pushed the parv/sync-payment-transport-v0.13 branch from 058352b to 2a77502 Compare July 28, 2026 18:26
@parvahuja
parvahuja force-pushed the parv/sync-payment-transport-v0.13 branch from 2a77502 to c0874a5 Compare July 28, 2026 23:14
@parvahuja
parvahuja force-pushed the parv/sync-payment-transport-v0.13 branch from c0874a5 to f0cd84d Compare July 28, 2026 23:23
@parvahuja
parvahuja force-pushed the parv/sync-payment-transport-v0.13 branch from f0cd84d to 69b2c5c Compare July 29, 2026 00:43
@parvahuja
parvahuja force-pushed the parv/sync-payment-transport-v0.13 branch from 69b2c5c to bc806af Compare July 29, 2026 01:02
@parvahuja
parvahuja force-pushed the parv/sync-payment-transport-v0.13 branch from bc806af to 7b23e75 Compare July 29, 2026 03:33
@parvahuja parvahuja changed the title feat: add synchronous payment transport feat: add owned runtime and synchronous payment transport Jul 29, 2026
@parvahuja
parvahuja force-pushed the parv/sync-payment-transport-v0.13 branch from 7b23e75 to 91d7d77 Compare July 29, 2026 03:43
@parvahuja
parvahuja force-pushed the parv/sync-payment-transport-v0.13 branch from 91d7d77 to 0a79c78 Compare July 29, 2026 03:50
@parvahuja
parvahuja force-pushed the parv/sync-payment-transport-v0.13 branch 2 times, most recently from 0049e56 to b77d4cb Compare July 29, 2026 21:04
@parvahuja
parvahuja force-pushed the parv/sync-payment-transport-v0.13 branch from b77d4cb to 75912ba Compare July 29, 2026 21:49
@parvahuja
parvahuja force-pushed the parv/sync-payment-transport-v0.13 branch from 75912ba to 1a926cc Compare July 30, 2026 17:59
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