Skip to main content

bind_inproc

Function bind_inproc 

Source
pub fn bind_inproc(endpoint: &str) -> Result<(InprocSender, InprocReceiver)>
Expand description

Bind to an inproc endpoint and return sender/receiver pair.

The endpoint is registered in the global registry. Multiple clients can connect to this endpoint using connect_inproc().

§Arguments

  • endpoint - The endpoint URI (must start with “inproc://”)

§Returns

Returns a tuple of (sender, receiver):

  • sender: Used to send messages from this socket
  • receiver: Used to receive messages sent by connected clients

§Errors

Returns an error if:

  • The endpoint doesn’t start with “inproc://”
  • The endpoint is already bound
  • The endpoint name is empty

§Example

use monocoque_core::inproc::bind_inproc;

let (sender, receiver) = bind_inproc("inproc://my-endpoint-bind").unwrap();
// sender and receiver are ready for use