@@ -13,73 +13,9 @@ A streaming rpc system based on quic
13
13
[ status link ] : https://github.com/n0-computer/quic-rpc/actions/workflows/rust.yml
14
14
[ repo link ] : https://github.com/n0-computer/quic-rpc
15
15
16
- ## Goals
16
+ # Goals
17
17
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/ ) .
83
19
84
20
# Docs
85
21
0 commit comments