1 unstable release
new 0.0.1 | May 13, 2025 |
---|
#86 in #tonic
82 downloads per month
71KB
1.5K
SLoC
soda-pool
⚠️ Note: Soda-pool library is in experimental stage.
Features may change, and breaking changes can occur while I integrate it in the production code I am working on. Use with caution.
Overview
Soda-pool is a set of libraries meant to help adapt tonic gRPC clients to be used in more dynamic world of microservices.
Soda-pool provides a dynamic, automatically managed pool of gRPC channels. Unlike the basic tonic's balanced channel, soda's pool is based on DNS resolution and automatically updates periodically to keep in sync with the true state of network.
Soda-pool is designed to be used in tandem with soda-pool-build rather than on it's own. Soda-pool-build builds upon soda-pool and tonic-build and can generate a gRPC client that on top of further simplifying channel pool management, supports also automatic request retrying.
Features
- Automatically managed and updated gRPC connection pool
- Configurable retrying of failed requests
For considered future features, see the roadmap.
Getting started
All of the documentation and examples assume prior familiarity with tonic ecosystem.
- example-generator crate has a basic example of using a builder to generate a client that uses soda-pool internally.
- example-protobuf crate has an exemplary client code generated by soda-pool-build.
- example-client crate has a basic example of using the aforementioned client.
While soda-pool channel pool can be used directly, it is not designed to be done so, so no examples are given beyond the crate's documentation.
Rust Version
At this experimental stage, crates are developed against the latest stable Rust version. I plan on lowering MSRV as far as reasonable soon.
Dependencies
Soda-pool and generated clients depends heavily on tonic
and tokio
and the generated client code shares dependencies with the one generated by tonic-build
.
Project Layout
- soda-pool: gRPC dynamic channel pool implementation.
- soda-poll-build: tonic-build based client codegen.
- example: Usage example used also for basic manual testing.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.Dependencies
~8–19MB
~258K SLoC