Allow stream reuse - #13
Open
plotnick wants to merge 3 commits into
Open
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Closed
Work in progress. Streams already end with an in-band end control; the receiver no longer demands transport EOF behind it. Every connect and accept now pairs the stream half with a Done handle, invoked at the protocol's end of the data with the half handed back; a half dropped anywhere else is an abort, observed as EOF. The routed adapter returns completed write halves through Dial::recycle (default: drop) and read halves to the router's header wait, so a pooling Dial carries stream after stream over one connection. Native stream types ride bare: no trait to implement, plain transports pair with Done::discard(). Full suite, conformance completion probes, and the suite over a pooling TCP dial all pass, along with every gate leg this box can run (it lacks cargo-audit, and the wasm leg has not had a full run).
A recovered connection is not usable until the previous stream's consumer lets it go, and the consumer may be lazy. A pool that hands the connection out earlier couples the next stream's delivery to that consumer's progress, which is the serialization the link contract forbids, and mutual sessions deadlock on the cycle. The router now writes one byte when it re-arms. A reusing dial consumes it off the dialing path and reuses only connections whose byte has arrived; a dial that awaits the byte inline re-creates the coupling at the open. The multi-thread regression test pins the safe discipline.
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.
sush will use qorb pools of sprockets connections in order to amortize the cost of RoT signatures (most of a second).
Also includes the trivial
Endpoint::local_addrmethod of #11, rebased on latest main.