Repository navigation
AUS-1016: embedded-host docs bundle and samples/EmbeddedHost - #175
Merged
Merged
Conversation
…dHost The API usability review (docs/reviews/2026-09-28_api-usability-review.md) found that every host outside ASP.NET Core rediscovers the same things: a guest process needs a session of its own, the raw-connection reply stream carries no framing, JsonFramer returns -1 for two different conditions, application error codes belong outside the reserved range, the cancellation token may sit between JSON parameters, and there is no dispatch context for a thread that owns the state. samples/EmbeddedHost is three hosts over one service, each about a page: HttpListener (body limit, deadline, 204 for notifications), any Stream with newline-delimited documents and a separate write loop (named pipe in the sample), and a SynchronizationContext that runs every document on one thread. Its check mode runs all three against a client. The project is in the solution and the sample README is a page on the documentation site. README: sessions guidance leads with a named session for guests; the hosting section gains the embedded subsection and the framer's -1 semantics; the raw connection sections state that replies carry no newline or Content-Length; the -32000 examples become application codes with the reason; unknown named members, the token's position, the public read path for bound methods (MetaData.Services), the adapter pattern for the context, and the AOT constraint are documented where a reader meets them.
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.
Docs bundle from the API usability review, plus the sample it points at. No library code changes.
samples/EmbeddedHost (in the solution, not packed): the core hosted without ASP.NET Core.
HttpListenerHost.cs: HTTP throughSystem.Net.HttpListener; body limit, a deadline the host arms itself (504 when it fires), 204 for a notification, 405 for anything but POST.StreamHost.cs: anyStream(a named pipe here) with newline-delimited documents both ways, framed withJsonFramer, a bounded buffer, documents run one at a time in order, and a separate write loop fed by a queue so pipelined clients cannot deadlock. Server-side events go out as notifications on the same queue. The-1fromFindDocumentEndis disambiguated so garbage answers-32700and closes instead of stalling.UiThread.cs: aSynchronizationContextover one thread; every document and every continuation inside a method runs there.dotnet run -- checkruns all three in process against a client; twelve checks, exit code 0. Run locally: all pass.README
-32602, never dropped. New "Reading what is bound" paragraph forMetaData.Services/RpcMethod/dele.-1semantics and buffer bounding; a new "Embedded" subsection walking the three sample files; the raw-connection paragraph now says replies carry no newline and noContent-Length(same in the AspNetCore README).-32000examples become application codes (1000,1001) with the reason: the specification reserves-32768..-32000.(int id, [JsonRpcCancellation] CancellationToken token, int limit = 10)is the natural shape.Site: the sample README is a page ("Embedded host sample", under More); local Typst build reports no missing anchors or files. CHANGELOG has an Added entry.
Linear: AUS-1016.