Skip to content

feat: one-way calls — Client::notify + Server skips the empty reply (7f) - #6

Merged
Kinflou merged 1 commit into
mainfrom
feat/runtime-oneway
Sep 1, 2026
Merged

feat: one-way calls — Client::notify + Server skips the empty reply (7f)#6
Kinflou merged 1 commit into
mainfrom
feat/runtime-oneway

Conversation

@Kinflou

@Kinflou Kinflou commented Sep 1, 2026

Copy link
Copy Markdown
Member

For _return: None schema functions: fire-and-forget, no response frame.

Client::notify<P>(call_id, &P) -> Result<(), RuntimeError> frames + sends a request, returns without a recv. Ok(()) = the frame left the transport, nothing more. Request ids stay monotonic across mixed call / notify.
Server::serve_one after dispatch, if the generated dispatcher wrote no Envelope, there's 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 — single-threaded pumping, and asserting a one-way call drew no reply.

Test

tests/oneway_roundtrip.rs — a Log { record(line: str); } stand-in for what comline-rust emits for a no-return function: the client notifys twice, the server pumps both frames and replies to neither, try_recv confirms the client's side stays silent.

Next

comline-rust maps _return: None → this (notify client method, silent dispatcher arm, plain fn f(&self, …) trait method); _return: Some(KindValue::Unit) stays request/response with an empty ack — finally using KindValue::Unit for its designed purpose (§4.4).

All feature configs green; clippy clean (bar the pre-existing sabi_trait lint).

…(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.
@Kinflou
Kinflou merged commit 435b7e8 into main Sep 1, 2026
6 checks passed
@Kinflou
Kinflou deleted the feat/runtime-oneway branch September 1, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant