| Crates.io | occams-rpc-tokio |
| lib.rs | occams-rpc-tokio |
| version | 0.2.0 |
| created_at | 2025-10-10 23:55:43.56321+00 |
| updated_at | 2025-10-26 09:19:22.18869+00 |
| description | occams-rpc runtime adaptor for tokio ecology occams-rpc is a modular, pluggable RPC for high throughput scenario, supports various runtimes, with a low-level streaming interface, and high-level remote API call interface. |
| homepage | |
| repository | https://github.com/NaturalIO/occams-rpc-tokio |
| max_upload_size | |
| id | 1877663 |
| size | 45,736 |
A modular, pluggable RPC for high throughput scenario, supports various runtimes, with a low-level streaming interface, and high-level remote API call interface.
occams-rpc is built from a collection of crates that provide different functionalities:
occams-rpc-core: core utils crateoccams-rpc-codec: Provides codecs for serialization, such as msgpack.occams-rpc-tokio: A runtime adapter for the tokio runtime.occams-rpc-smol: A runtime adapter for the smol runtime.occams-rpc-tcp: A TCP transport implementation.The interface is designed to optimize throughput and lower CPU consumption for high-performance services.
Each connection is a full-duplex, multiplexed stream.
There's a seq ID assigned to a packet to track
a request and response. The timeout of a packet is checked in batches every second.
We utilize the crossfire channel for parallelizing the work with
coroutines.
With an ClientStream (used in ClientPool and FailoverPool), the request sends in sequence, flush in batches,
and wait a slicing window throttler controlling the number of in-flight packets.
An internal timer then registers the request through a channel, and when the response is received,
it can optionally notify the user through a user-defined channel or another mechanism.
In an RpcServer, for each connection, there is one coroutine to read requests and one
coroutine to write responses. Requests can be dispatched with a user-defined
Dispatch trait implementation.
impl Future definition of rust since 1.75, also support legacy async_trait
wrapper(Warning: The API and feature is still evolving, might changed in the future)