Expand description
Connection state machines and transport listeners.
This module wires together the I/O substrate from
crate::io, the message model from crate::msg, and the
protocol codecs in crate::proto into a runtime that:
- accepts client connections through a
proxy::Proxylistener, - accepts inbound peer connections through a
dnode_proxy::DnodeProxylistener, - fans out to backend datastores through a per-pool
pool::ConnPoolof outboundserver::ServerConns, - fans out to peer nodes through a
dnode_server::DnodeServerConnoutbound connection, - tracks consecutive-failure auto-eject decisions via
auto_eject::AutoEject.
Every connection holds a boxed
Transport so the same FSM
drives TCP today and QUIC behind the quic cargo feature.
Cluster routing decisions (request forwarding across racks /
DCs, peer selection, gossip) live in Stage 10’s cluster::*
module and are dispatched into via the Dispatcher trait
below.
§Examples
use dynomite::net::{ConnPool, ConnPoolConfig};
let cfg = ConnPoolConfig {
max_connections: 4,
server_failure_limit: 3,
server_retry_timeout_ms: 1_000,
auto_eject: true,
};
let pool: ConnPool<TcpTransport> = ConnPool::new(cfg);
assert_eq!(pool.config().max_connections, 4);Re-exports§
pub use self::auto_eject::AutoEject;pub use self::auto_eject::AutoEjectState;pub use self::client::ClientHandler;pub use self::client::ClientLoopOutcome;pub use self::conn::Conn;pub use self::conn::ConnHandle;pub use self::conn::ConnStats;pub use self::dispatcher::DispatchOutcome;pub use self::dispatcher::Dispatcher;pub use self::dispatcher::NoopDispatcher;pub use self::dispatcher::OutboundEnvelope;pub use self::dispatcher::ServerSink;pub use self::dnode_client::DnodeClientHandler;pub use self::dnode_proxy::DnodeProxy;pub use self::dnode_server::DnodeServerConn;pub use self::listener::bind_dual_stack;pub use self::listener::BindOptions;pub use self::pool::ConnFactory;pub use self::pool::ConnHandle as PoolHandle;pub use self::pool::ConnPool;pub use self::pool::ConnPoolConfig;pub use self::proxy::Proxy;pub use self::server::ServerConn;pub use self::tls::acceptor_from;pub use self::tls::connector_from;pub use self::tls::load_client_config;pub use self::tls::load_server_config;pub use self::tls::server_name_owned;pub use self::tls::TlsClientTransport;pub use self::tls::TlsError;pub use self::tls::TlsServerTransport;
Modules§
- auto_
eject - Consecutive-failure auto-eject decision state.
- client
- CLIENT-role connection driver.
- conn
- Per-connection state and the shared event loop.
- dispatcher
- Cluster-side dispatch hook.
- dnode_
client - Inbound peer-connection driver for the dnode peer plane.
- dnode_
proxy - DNODE_PEER_PROXY listener.
- dnode_
server - DNODE_PEER_SERVER-role connection driver.
- listener
- Dual-stack listener helpers.
- pool
- Outbound connection pool with backoff and auto-eject.
- proxy
- PROXY listener.
- server
- SERVER-role connection driver.
- tls
- TLS helpers for the peer plane and the Riak gateways.
Enums§
- NetError
- Top-level error type returned by net::* operations.