Repository navigation
Document the RPC client protocol reply contract - #10171
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 200321e The changes in this PR will be included in the next version bump. This PR includes changesets to release 33 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|
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.
This documents the reply contract between
RpcClientand a clientProtocol, and shows how a transport that only delivers requests (a message queue, a one-way socket) can still supportdiscard: truecalls. Runtime code and tests are unchanged.RpcClient.Protocol: aRequestthatsendaccepts stays pending until a reply names its id: anExit, or aClientProtocolErrorthat lists it inrequestIds. Until then the client keeps the request and the caller's context, unless the caller is interrupted, the client closes or the connection fails. A delivery-only transport writes a voidExitfor adiscardrequest once it has delivered it, and failssendwith anRpcClientErrorfor any other request.discardoption (normal and flat client): one sentence saying that a protocol that only delivers requests acknowledges the call itself once it has delivered the request.The docs recommend failing
sendto reject other requests rather than writing a request-scopedClientProtocolError. A failed send fails only its own call and works on released versions.ClientProtocolError.requestIdsis not in any release yet: it was added by #10120 aftereffect@4.1.0.This replaces #10165, which added a
supportsRepliesprotocol capability. The existing contract already covers the use case, so a new required field on a public service isn't needed.Closes #10159
Closes EFF-3149