pub struct LlmpClient<SP> where
    SP: ShMemProvider
{ pub sender: LlmpSender<SP>, pub receiver: LlmpReceiver<SP>, }
Expand description

Client side of LLMP

Fields

sender: LlmpSender<SP>

Outgoing channel to the broker

receiver: LlmpReceiver<SP>

Incoming (broker) broadcast map

Implementations

n clients connect to a broker. They share an outgoing map with the broker, and get incoming messages from the shared broker bus

Reattach to a vacant client map. It is essential, that the broker (or someone else) kept a pointer to the out_shmem else reattach will get a new, empty page, from the OS, or fail

Recreate this client from a previous [client.to_env()]

Write the current state to env. A new client can attach to exactly the same state by calling LlmpClient::on_existing_shmem().

Describe this client in a way that it can be recreated, for example after crash

Create an existing client from description

Waits for the sender to be save to unmap. If a receiver is involved on the other side, this function should always be called.

If we are allowed to unmap this client

For debug purposes: mark the client as save to unmap, even though it might not have been read.

Safety

This should only be called in a debug scenario. Calling this in other contexts may lead to a premature page unmap and result in a crash in another process, or an unexpected read from an empty page in a receiving process.

Creates a new LlmpClient

Commits a msg to the client’s out map

Safety

Needs to be called with a proper msg pointer

Allocates a message of the given size, tags it, and sends it off.

Send a buf with the given flags.

Informs the broker about a new client in town, with the given map id

A client receives a broadcast message. Returns null if no message is availiable

Safety

Should be save, unless the internal state is corrupt. Returns raw ptr.

A client blocks/spins until the next message gets posted to the page, then returns that message.

Safety

Should be save, unless the internal state is corrupt. Returns raw ptr.

The current page could have changed in recv (EOP). Alloc the next message, internally handling end of page by allocating a new one.

Safety

Should be safe, but returns an unsafe ptr

Returns the next message, tag, buf, if available, else None

Receives a buf from the broker, looping until a message becomes available

Receive a buf from the broker, including the flags used during transmission.

Creates a new LlmpClient, reading the map id and len from env

Create a LlmpClient, getting the ID from a given port

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.