feat: one-way calls — Client::notify + Server skips the empty reply (7f) - #6
Merged
Conversation
…(7f)
For `_return: None` schema functions: fire-and-forget, no response frame.
- Client::notify<P>(call_id, &P) -> Result<(), RuntimeError> -- frames and
sends a request, returns without a recv. Request ids stay monotonic.
- Server::serve_one -- after dispatch, if the (generated) dispatcher wrote
no Envelope, there is nothing to reply: skip encode_response + send.
Any real envelope is >= 1 tag byte, so "empty" is unambiguous. No wire
or contract change.
- InMemory::try_recv -- non-blocking receive, for single-threaded pumping
and for asserting a one-way call drew no reply.
tests/oneway_roundtrip.rs: a Log { record(line: str); } stand-in --
client notifies twice, the server pumps both and replies to neither,
try_recv confirms the client's side is silent.
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.
For
_return: Noneschema functions: fire-and-forget, no response frame.Client::notify<P>(call_id, &P) -> Result<(), RuntimeError>recv.Ok(())= the frame left the transport, nothing more. Request ids stay monotonic across mixedcall/notify.Server::serve_onedispatch, if the generated dispatcher wrote noEnvelope, there's nothing to reply — skipencode_response+send. Any real envelope is ≥ 1 tag byte, so "empty" is unambiguous. No wire or contract change.InMemory::try_recvTest
tests/oneway_roundtrip.rs— aLog { record(line: str); }stand-in for whatcomline-rustemits for a no-returnfunction: the clientnotifys twice, the server pumps both frames and replies to neither,try_recvconfirms the client's side stays silent.Next
comline-rustmaps_return: None→ this (notifyclient method, silent dispatcher arm, plainfn f(&self, …)trait method);_return: Some(KindValue::Unit)stays request/response with an empty ack — finally usingKindValue::Unitfor its designed purpose (§4.4).All feature configs green; clippy clean (bar the pre-existing
sabi_traitlint).