Skip to content

Commit b602f86

Browse files
committed
Just refer to the module docs from the readme
1 parent 5a09a77 commit b602f86

File tree

3 files changed

+8
-72
lines changed

3 files changed

+8
-72
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ n0-future = { version = "0.1.2" }
5555
# enable the remote transport
5656
rpc = ["dep:quinn", "dep:postcard", "dep:anyhow", "dep:smallvec", "dep:tracing", "tokio/io-util"]
5757
# add test utilities
58-
test = ["rpc", "dep:rustls", "dep:rcgen", "dep:anyhow", "dep:futures-buffered"]
58+
quinn_endpoint_setup = ["rpc", "dep:rustls", "dep:rcgen", "dep:anyhow", "dep:futures-buffered"]
5959
# pick up parent span when creating channel messages
6060
message_spans = []
61-
default = ["rpc", "test", "message_spans"]
61+
default = ["rpc", "quinn_endpoint_setup", "message_spans"]
6262

6363
[workspace]
6464
members = ["quic-rpc-derive", "quic-rpc-iroh"]

README.md

+2-66
Original file line numberDiff line numberDiff line change
@@ -13,73 +13,9 @@ A streaming rpc system based on quic
1313
[status link]: https://github.com/n0-computer/quic-rpc/actions/workflows/rust.yml
1414
[repo link]: https://github.com/n0-computer/quic-rpc
1515

16-
## Goals
16+
# Goals
1717

18-
### Interaction patterns
19-
20-
Provide not just request/response RPC, but also streaming in both directions, similar to [grpc].
21-
22-
- 1 req -> 1 res
23-
- 1 req, update stream -> 1 res
24-
- 1 req -> res stream
25-
- 1 req, update stream -> res stream
26-
27-
It is still a RPC system in the sense that interactions get initiated by the client.
28-
29-
### Transports
30-
31-
- memory transport with very low overhead. In particular, no ser/deser, currently using [tokio channels]
32-
when using tokio channels, there is zero overhead compared to just manually including backchannels in messages
33-
- quic transport via the [iroh-quinn] crate
34-
35-
### API
36-
37-
- The API should be similar to the quinn api. Basically "quinn with types".
38-
39-
## Non-Goals
40-
41-
- Cross language interop. This is for talking from rust to rust
42-
- Any kind of versioning. You have to do this yourself
43-
- Making remote message passing look like local async function calls
44-
- Being runtime agnostic. This is for tokio
45-
46-
## Example
47-
48-
[computation service](https://github.com/n0-computer/quic-rpc/blob/main/tests/math.rs)
49-
50-
## Why?
51-
52-
The purpose of quic-rpc is to serve as an *optional* rpc framework. One of the
53-
main goals is to be able to use it as an *in process* way to have well specified
54-
protocols and boundaries between subsystems, including an async boundary.
55-
56-
It should not have noticeable overhead compared to what you would do anyway to
57-
isolate subsystems in a complex single process app, but should have the *option*
58-
to also send messages over a process boundary via one of the non mem transports.
59-
60-
What do you usually do in rust to have isolation between subsystems, e.g.
61-
between a database and a networking layer? You have some kind of
62-
channel between the systems and define messages flowing back and forth over that
63-
channel. For almost all interactions these messages itself will again contain
64-
(oneshot or mpsc) channels for independent async communication between the
65-
subsystems.
66-
67-
Quic-rpc with the mem channel does exactly the same thing, except that it
68-
distinguishes between the serializable protocol of a service and the full
69-
messages of a service that include unserializable channels.
70-
71-
Instead of having a message that explicitly contains some data and the send side
72-
of a oneshot or mpsc channel for the response, it allows you to specify the
73-
channel kind and message type of the channels in both directions.
74-
75-
For the case where you have a process boundary, the overhead is very low for
76-
transports that already have a concept of cheap substreams (http2, quic, ...).
77-
Quic is the poster child of a network transport that has built in cheap
78-
substreams including per substream backpressure.
79-
80-
[iroh-quinn]: https://docs.rs/iroh-quinn/
81-
[tokio channels]: https://docs.rs/tokio/latest/tokio/sync/index.html
82-
[grpc]: https://grpc.io/
18+
See the [module docs](https://docs.rs/quic-rpc/latest/quic_rpc/).
8319

8420
# Docs
8521

src/util.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
//!
33
//! This module contains utilities to read and write varints, as well as
44
//! functions to set up quinn endpoints for local rpc and testing.
5-
#[cfg(feature = "test")]
6-
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "test")))]
5+
#[cfg(feature = "quinn_endpoint_setup")]
6+
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "quinn_endpoint_setup")))]
77
mod quinn_setup_utils {
88
use std::{net::SocketAddr, sync::Arc};
99

@@ -143,8 +143,8 @@ mod quinn_setup_utils {
143143
}
144144
}
145145
}
146-
#[cfg(feature = "test")]
147-
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "test")))]
146+
#[cfg(feature = "quinn_endpoint_setup")]
147+
#[cfg_attr(quicrpc_docsrs, doc(cfg(feature = "quinn_endpoint_setup")))]
148148
pub use quinn_setup_utils::*;
149149

150150
#[cfg(feature = "rpc")]

0 commit comments

Comments
 (0)