Skip to main content

rlmesh_grpc/
lib.rs

1pub mod connect;
2pub mod env;
3pub mod error;
4pub mod health;
5pub mod helpers;
6pub mod lifecycle;
7pub mod model;
8pub mod states;
9pub mod wire;
10
11/// gRPC encode/decode limit used by RLMesh clients and servers.
12///
13/// The tonic default is 4 MiB. RLMesh raises it so vectorized observations such
14/// as 64 float32 Atari frames fit without tripping transport limits.
15pub const MAX_MESSAGE_SIZE: usize = 256 * 1024 * 1024;
16
17/// Configure endpoint timeouts and keepalives.
18pub(crate) fn configure_endpoint(
19    endpoint: tonic::transport::Endpoint,
20) -> tonic::transport::Endpoint {
21    endpoint
22        .connect_timeout(std::time::Duration::from_secs(10))
23        .http2_keep_alive_interval(std::time::Duration::from_secs(30))
24        .keep_alive_timeout(std::time::Duration::from_secs(10))
25        .keep_alive_while_idle(true)
26        .tcp_keepalive(Some(std::time::Duration::from_secs(60)))
27}
28
29pub use connect::{ConnectOptions, retry_connect};
30pub use env::{EnvClient, EnvHandshake};
31pub use lifecycle::{DEFAULT_PREDICT_CONCURRENCY, ServeOptions};
32pub use model::ModelClient;