Repository navigation
Description
Problem
PushNotificationDeliveryClient::Deliver and HttpPushNotificationDeliveryClient::Deliver use synchronous outbound HTTP requests. A remote webhook that is slow or unavailable can therefore hold application/server workers even after async server execution becomes available.
Goal
Provide an opt-in asynchronous push delivery operation with cancellation, timeouts and deterministic shutdown, reusing the shared non-blocking outbound libcurl machinery introduced for async HTTP unary clients in #269.
Ownership and issue boundaries (v0.6.0)
Owns: Opt-in asynchronous outbound push HTTP delivery and server integration. Reuse #269's outbound HTTP async request primitive and completion semantics; preserve synchronous delivery.
Prerequisites and integration: Hard prerequisite: #269 shared libcurl HTTP async primitive (after its HTTP checkpoints), not #269 gRPC client. Integrate with #268's async services without changing the dispatcher. #270 is unrelated inbound network I/O.
Must not absorb: No separate HTTP reactor, per-delivery worker/thread, durable retry queue, persistence schema, push-payload redesign, or change to existing synchronous delivery.
Issue management: Retain this issue and use separate independently reviewable PRs for the checkpoints below. Close only when final acceptance criteria pass. Do not pull future checkpoints into earlier PRs.
Implementation PR checklist
- PR 1 — Delivery contract and fake-requester tests: ownership, timeout/deadline, cancellation, exact-once completion, shutdown and sync result/error parity.
- PR 2 — Reuse [Enhancement]: Add opt-in async unary A2A client operations #269 HTTP async primitive for real non-blocking webhook delivery, including in-flight/callback bounds and localhost failure/cancel/concurrency tests.
- PR 3 — Opt-in [Enhancement]: Add opt-in async unary server execution and cancellation #268 server integration with no changes to legacy sync execution; documentation, thread/resource evidence and push TCK/performance checks.
PR merge rule: Narrow changes, deterministic scope-specific tests, documented lifecycle ownership, and applicable AGENTS.md validation. Measure performance-sensitive behavior against equivalent baseline workloads. Preserve synchronous behavior.
Detailed technical requirements — scope and delivery phases
Phase 1 — Delivery contract
- Preserve the existing synchronous
Deliver(...)methods,PushDeliveryRequestsemantics, HTTP payload format and error/result mapping. - Add a parallel asynchronous delivery operation consistent with the async client API/lifecycle conventions chosen under [Enhancement]: Add opt-in async unary A2A client operations #269.
- Specify ownership, deadline and cancellation rules, callback execution context, exactly-once completion and shutdown behavior.
- Test success/error/timeout/cancellation semantics using a fake outbound requester before binding to the socket reactor.
Phase 2 — Non-blocking outbound implementation
- Reuse [Enhancement]: Add opt-in async unary A2A client operations #269's shared libcurl multi/reactor implementation rather than creating a second per-delivery reactor or network worker.
- Honor connection reuse, bounded in-flight requests/callback backlogs, failure mapping, cancellation wakeups and shutdown cancellation.
- Ensure application callbacks never run on the libcurl reactor thread and slow callbacks cannot stall unrelated deliveries.
- Add native integration tests with a controllable localhost webhook: success, non-2xx, connection failure, delayed response, timeout, cancel/complete race, shutdown and concurrent deliveries.
Phase 3 — Async server integration and validation
- Make the delivery operation usable by the opt-in async executor/services from [Enhancement]: Add opt-in async unary server execution and cancellation #268 without forcing any change on existing synchronous executors.
- Document API usage and compare thread/resource use at increasing in-flight delivery counts.
- Verify existing push-notification TCK and synchronous delivery behavior remain unchanged.
Dependencies and boundaries
- #269: needs a stable shared HTTP asynchronous request mechanism and lifecycle contract, not necessarily all gRPC client phases.
- #268: integration consumer, not a reason to modify unary dispatcher implementation here.
- #270: inbound HTTP server and unrelated to outgoing webhook socket scheduling.
Out of scope
- Durable delivery queues, retry scheduling/exponential backoff, delivery persistence, changes to push payloads or A2A protocol semantics.
- A new HTTP network stack or one dedicated thread/reactor per webhook.
- A wholesale redesign of server execution or subscription lifecycle.
Acceptance criteria
- Synchronous delivery stays source-compatible and continues passing existing tests.
- Async API provides same request/result meaning with explicit timeout, cancellation and shutdown behavior.
- Shared libcurl multi infrastructure handles concurrent deliveries without per-delivery SDK threads.
- Completion happens once, callbacks stay off the network reactor, and queues/in-flight operations are bounded.
- Deterministic unit/integration tests cover success, failures, cancellation races, timeout and shutdown.
- Existing push TCK, formatting/lint, supported-platform checks and mandatory performance smoke pass.
- Documentation explains sync and async usage, limitations and ownership.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIn Review
Activity
feat(server): add asynchronous HTTP push delivery (#326)