pub struct LlmpBroker<SP> where
    SP: ShMemProvider + 'static, 
{ pub llmp_out: LlmpSender<SP>, pub llmp_clients: Vec<LlmpReceiver<SP>>, /* private fields */ }
Expand description

The broker (node 0)

Fields

llmp_out: LlmpSender<SP>

Broadcast map from broker to all clients

llmp_clients: Vec<LlmpReceiver<SP>>

Users of Llmp can add message handlers in the broker. This allows us to intercept messages right in the broker. This keeps the out map clean.

Implementations

The broker forwards all messages to its own bus-like broadcast map. It may intercept messages passing through.

Create and initialize a new LlmpBroker

Create a new LlmpBroker sttaching to a TCP port

Registers a new client for the given sharedmap str and size. Returns the id of the new client in [broker.client_shmem]

Connects to a broker running on another machine. This will spawn a new background thread, registered as client, that proxies all messages to a remote machine. Returns the description of the new page that still needs to be announced/added to the broker afterwards.

The broker walks all pages and looks for changes, then broadcasts them on its own shared page, once.

Loops infinitely, forwarding and handling all incoming messages from clients. Never returns. Panics on error. 5 millis of sleep can’t hurt to keep busywait not at 100%

Broadcasts the given buf to all clients

Sends a buf with the given flags.

Launches a thread using a tcp listener socket, on which new clients may connect to this broker. Does so on the given port.

Launches a thread using a listener socket, on which new clients may connect to this broker

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The Resulting TupleList, of an Prepend::prepend() call, including the prepended entry. Read more

Prepend a value to this tuple, returning a new tuple with prepended value.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.