Crates.io | ginepro |
lib.rs | ginepro |
version | |
source | src |
created_at | 2021-05-12 15:06:03.187331 |
updated_at | 2024-12-09 15:44:06.505642 |
description | A client-side gRPC channel implementation for tonic |
homepage | |
repository | https://github.com/TrueLayer/ginepro |
max_upload_size | |
id | 396546 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
ginepro
provides client-side gRPC load-balancing out of the box by enriching tonic
‘s channel with periodic service discovery.
ginepro
enriches tonic by periodically updating the list of
servers that are available through a ServiceDiscovery
interface that currently is implemented for DNS.
Add ginepro
to your dependencies
cargo add ginepro
The interface remains fairly the same as we implement all the logic for a drop-in replacement for
tonic's Channel
.
// Using the `LoadBalancedChannel`.
use ginepro::LoadBalancedChannel;
use ginepro::pb::tester_client::TesterClient;
// Build a load-balanced channel given a service name and a port.
let load_balanced_channel = LoadBalancedChannel::builder(
("my_hostname", 5000)
)
.channel()
.await
.expect("failed to construct LoadBalancedChannel");
// Initialise a new gRPC client for the `Test` service
// using the load-balanced channel as transport
let grpc_client = TesterClient::new(load_balanced_channel);
For more examples, have a look at the examples directory.