Skip to content

Conversation

@zh4ngx
Copy link
Contributor

@zh4ngx zh4ngx commented Nov 4, 2025

Implement stream-quic-{client, server} based on streams-nats-{client, server} and hello-quic-{client, server}.

Should the handling of multiple invocation streams follow the approach in hello-quic-server or stream-nats-server?

@rvolosatovs

@zh4ngx zh4ngx requested a review from rvolosatovs as a code owner November 4, 2025 23:47
@zh4ngx zh4ngx force-pushed the streams-quic-example branch from b07a41d to 2535e9a Compare November 4, 2025 23:54
@rvolosatovs
Copy link
Member

Should the handling of multiple invocation streams follow the approach in hello-quic-server or stream-nats-server?

they seem to be identical other that the QUIC version having to abort accepts on shutdown, could you elaborate?

@rvolosatovs rvolosatovs enabled auto-merge November 5, 2025 16:15
@rvolosatovs rvolosatovs disabled auto-merge November 5, 2025 16:16
@zh4ngx
Copy link
Contributor Author

zh4ngx commented Nov 5, 2025

Should the handling of multiple invocation streams follow the approach in hello-quic-server or stream-nats-server?

they seem to be identical other that the QUIC version having to abort accepts on shutdown, could you elaborate?

Sure, I think it might be around more general questions:

  • What is the role of the task collection here, and why does it not appear in the nats example?
  • Why is there no srv.accept(...) step in stream-nats-server like there is in hello-quic-server?
  • How does bindings::serve(...) work? In hello-quic-server it takes a wrpc_transport_quic::Server, but in stream-nats-server it takes in a wrpc_transport_nats::Client.

Thanks!

@rvolosatovs
Copy link
Member

Should the handling of multiple invocation streams follow the approach in hello-quic-server or stream-nats-server?

they seem to be identical other that the QUIC version having to abort accepts on shutdown, could you elaborate?

Sure, I think it might be around more general questions:

* What is the role of the task collection [here](https://github.com/bytecodealliance/wrpc/blob/main/examples/rust/hello-quic-server/src/main.rs#L74-L112), and why does it not appear in the nats example?

* Why is there no `srv.accept(...)` step in `stream-nats-server` like there is in [`hello-quic-server`](https://github.com/bytecodealliance/wrpc/blob/main/examples/rust/hello-quic-server/src/main.rs#L89)?

* How does `bindings::serve(...)` work? In [`hello-quic-server`](https://github.com/bytecodealliance/wrpc/blob/main/examples/rust/hello-quic-server/src/main.rs#L114) it takes a `wrpc_transport_quic::Server`, but in [`stream-nats-server`](https://github.com/bytecodealliance/wrpc/blob/main/examples/rust/streams-nats-server/src/main.rs#L69) it takes in a `wrpc_transport_nats::Client`.

Thanks!

In case of NATS.io there is a single connection to the NATS broker and "accepting" is done behind the scenes by async-nats crate and framing is handled by the NATS protocol, whereas in case of QUIC, we have to perform the accept ourselves, handle framing and pass the accepted connection to wRPC.

This is all quite low-level and we should definitely introduce a higher-level abstraction with opinionated defaults for developers who don't necessarily require this high degree of control

@rvolosatovs rvolosatovs disabled auto-merge November 10, 2025 11:36
@rvolosatovs rvolosatovs added this pull request to the merge queue Nov 10, 2025
Merged via the queue into bytecodealliance:main with commit ba98119 Nov 10, 2025
38 checks passed
@zh4ngx zh4ngx deleted the streams-quic-example branch November 10, 2025 21:02
@zh4ngx
Copy link
Contributor Author

zh4ngx commented Nov 11, 2025

Should the handling of multiple invocation streams follow the approach in hello-quic-server or stream-nats-server?

they seem to be identical other that the QUIC version having to abort accepts on shutdown, could you elaborate?

Sure, I think it might be around more general questions:

* What is the role of the task collection [here](https://github.com/bytecodealliance/wrpc/blob/main/examples/rust/hello-quic-server/src/main.rs#L74-L112), and why does it not appear in the nats example?

* Why is there no `srv.accept(...)` step in `stream-nats-server` like there is in [`hello-quic-server`](https://github.com/bytecodealliance/wrpc/blob/main/examples/rust/hello-quic-server/src/main.rs#L89)?

* How does `bindings::serve(...)` work? In [`hello-quic-server`](https://github.com/bytecodealliance/wrpc/blob/main/examples/rust/hello-quic-server/src/main.rs#L114) it takes a `wrpc_transport_quic::Server`, but in [`stream-nats-server`](https://github.com/bytecodealliance/wrpc/blob/main/examples/rust/streams-nats-server/src/main.rs#L69) it takes in a `wrpc_transport_nats::Client`.

Thanks!

In case of NATS.io there is a single connection to the NATS broker and "accepting" is done behind the scenes by async-nats crate and framing is handled by the NATS protocol, whereas in case of QUIC, we have to perform the accept ourselves, handle framing and pass the accepted connection to wRPC.

This is all quite low-level and we should definitely introduce a higher-level abstraction with opinionated defaults for developers who don't necessarily require this high degree of control

Got it - thanks for the explanation. Yes, that sounds like a good idea. Would be happy to help with that as I get more familiar with the internals.

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.

2 participants