feat(transport): Add service multiplexing/routing (#99)
* feat(transport): Add service multiplexing/routing
This change introduces a new "router" built on top of
`transport::Server` that allows one to run multiple
gRPC services on the same socket.
```rust
Server::builder()
.add_service(greeter)
.add_service(echo)
.serve(addr)
.await?;
```
There is also a new `multiplex` example showcasing
server side service multiplexing and client side
service multiplexing.
BREAKING CHANGES: `Server::serve` is now crate private
and all services must be added via `Server::add_service`.
Codegen also returns just a `Service` now instead of a
`MakeService` pair.
Closes #29
Signed-off-by: Lucio Franco [email protected]
This commit is contained in:
@@ -52,6 +52,14 @@ path = "src/tls_client_auth/server.rs"
|
||||
name = "tls-client-auth-client"
|
||||
path = "src/tls_client_auth/client.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "multiplex-server"
|
||||
path = "src/multiplex/server.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "multiplex-client"
|
||||
path = "src/multiplex/client.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "gcp-client"
|
||||
path = "src/gcp/client.rs"
|
||||
|
||||
Reference in New Issue
Block a user