* 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]
88 lines
1.6 KiB
TOML
88 lines
1.6 KiB
TOML
[package]
|
|
name = "tonic-examples"
|
|
version = "0.1.0"
|
|
authors = ["Lucio Franco <[email protected]>"]
|
|
edition = "2018"
|
|
|
|
[[bin]]
|
|
name = "helloworld-server"
|
|
path = "src/helloworld/server.rs"
|
|
|
|
[[bin]]
|
|
name = "helloworld-client"
|
|
path = "src/helloworld/client.rs"
|
|
|
|
[[bin]]
|
|
name = "routeguide-server"
|
|
path = "src/routeguide/server.rs"
|
|
|
|
[[bin]]
|
|
name = "routeguide-client"
|
|
path = "src/routeguide/client.rs"
|
|
|
|
[[bin]]
|
|
name = "authentication-client"
|
|
path = "src/authentication/client.rs"
|
|
|
|
[[bin]]
|
|
name = "authentication-server"
|
|
path = "src/authentication/server.rs"
|
|
|
|
[[bin]]
|
|
name = "load-balance-client"
|
|
path = "src/load_balance/client.rs"
|
|
|
|
[[bin]]
|
|
name = "load-balance-server"
|
|
path = "src/load_balance/server.rs"
|
|
|
|
[[bin]]
|
|
name = "tls-client"
|
|
path = "src/tls/client.rs"
|
|
|
|
[[bin]]
|
|
name = "tls-server"
|
|
path = "src/tls/server.rs"
|
|
|
|
[[bin]]
|
|
name = "tls-client-auth-server"
|
|
path = "src/tls_client_auth/server.rs"
|
|
|
|
[[bin]]
|
|
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"
|
|
|
|
[dependencies]
|
|
tonic = { path = "../tonic", features = ["rustls"] }
|
|
bytes = "0.4"
|
|
prost = "0.5"
|
|
|
|
tokio = "=0.2.0-alpha.6"
|
|
futures-preview = { version = "=0.3.0-alpha.19", default-features = false, features = ["alloc"]}
|
|
async-stream = "0.1.2"
|
|
http = "0.1"
|
|
tower = "=0.3.0-alpha.2"
|
|
|
|
# Required for routeguide
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
rand = "0.7.2"
|
|
|
|
# Required for wellknown types
|
|
prost-types = "0.5"
|
|
|
|
[build-dependencies]
|
|
tonic-build = { path = "../tonic-build" }
|