Expand description
In-process transport for zero-copy messaging within the same process.
The inproc transport provides high-performance communication between sockets in the same process using channels, without TCP/IP overhead.
§Features
- Zero-copy: Messages are shared via
Arc<Vec<Bytes>>between sockets - Thread-safe: Global registry protected by
DashMap - Fast: No serialization, network, or syscall overhead
ZeroMQcompatible: Usesinproc://URI scheme
§Usage
ⓘ
use monocoque_core::inproc::{bind_inproc, connect_inproc};
use bytes::Bytes;
// Bind to an inproc endpoint
let (sender, receiver) = bind_inproc("inproc://my-endpoint").unwrap();
// Connect from another task
let client = connect_inproc("inproc://my-endpoint").unwrap();
// Send messages
client.send(vec![Bytes::from("Hello")]).unwrap();
// Receive messages
if let Ok(msg) = receiver.recv() {
println!("Received: {:?}", msg);
}Functions§
- bind_
inproc - Bind to an inproc endpoint and return sender/receiver pair.
- bind_
inproc_ bidi - Bind to an inproc endpoint for bidirectional communication.
- connect_
inproc - Connect to an inproc endpoint.
- connect_
inproc_ bidi - Connect to an inproc endpoint for bidirectional communication.
- list_
inproc_ endpoints - List all currently bound inproc endpoints.
- unbind_
inproc - Unbind an inproc endpoint, removing it from the global registry.
Type Aliases§
- Inproc
Message - Message type for inproc transport (multipart message)
- Inproc
Receiver - Receiver half of an inproc connection
- Inproc
Sender - Sender half of an inproc connection