Add bounded application notifications for retained callbacks - #5
Merged
Conversation
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.
A producer can wake a retained HTTP callback without retaining an application worker.
Context.notification()returns a generation-checked handle.waitNotification(?u64)releases the callback until a signal or optional timer arrives. The callback resumes with.notifiedor.timer.Each connection reserves one atomic signal cell at startup. Signals coalesce and return
notified,coalesced, orstale. Signals survive callbacks and pending output. A pending signal takes precedence over the optional notification timer. Ordinary timer waits keep their existing behavior.Request generations never wrap. Terminal results and connection close invalidate handles. Producers must stop and join before server or cluster deinitialization. Application queues synchronize their own data; notifications only indicate available work. The owner scans waits during its existing poll cycle, with up to 10 ms plus scheduling delays. This change adds no OS wake primitive or
std.Ioprovider.All native gates passed on
886b728bec79c36ca1ec69345b609a725617a9ea, using exact Zig 0.16.0. Runtime suites used ReleaseSafe binaries.Linux/macOS native evidence and Windows native evidence include complete logs and receipts. The duplicate pull-request native run also passed.
Deterministic tests cover concurrent coalescing, stale generations, retirement, terminal invalidation, pending callbacks, timers, and frozen output. Wire cases cover 32 waiting requests with one worker, pipeline ordering, timeout precedence, disconnect, deadline, shutdown, and reuse. Linux and Windows also passed three-owner notification tests. macOS currently supports one owner, so its two three-owner tests remain explicit skips.
Windows also passed nine existing shard groups and the 30,000-response correctness smoke gate. Four existing POSIX suspension cases remain excluded on Windows. These results provide native correctness evidence, not performance or physical Windows deployment qualification.
Local macOS Debug/ReleaseSafe verification and targeted wire gates also passed. The whitepaper generation check passed. All owned local test processes exited before host reservation release. Downloaded native packets were inspected and hashed; the Windows source receipt matches all 29 local input files.
The PR is ready for review and remains unmerged.