59 bool send(
const void*
data,
size_t len, uint64_t timeout_ns)
override
66 size_t total_size =
sizeof(uint32_t) +
len;
67 void* buf =
producer_->claim(total_size,
static_cast<uint32_t
>(timeout_ns));
73 auto len_u32 =
static_cast<uint32_t
>(
len);
Abstract interface for IPC client.
static MpscProducer connect(const std::string &name, size_t producer_id)
Connect to MPSC system as a producer.
IPC client for multi-client shared memory server.
std::optional< MpscProducer > producer_
MpscShmClient(MpscShmClient &&)=delete
MpscShmClient & operator=(const MpscShmClient &)=delete
MpscShmClient(const MpscShmClient &)=delete
std::span< const uint8_t > receive(uint64_t timeout_ns) override
Receive a message from the server (zero-copy for shared memory)
bool send(const void *data, size_t len, uint64_t timeout_ns) override
Send a message to the server.
std::optional< SpscShm > response_ring_
~MpscShmClient() override=default
void close() override
Close the connection.
MpscShmClient(std::string base_name, size_t client_id)
MpscShmClient & operator=(MpscShmClient &&)=delete
bool connect() override
Connect to the server.
void release(size_t message_size) override
Release the previously received message.
static SpscShm connect(const std::string &name)
Connect to existing SPSC ring buffer.
const std::vector< MemoryValue > data
Multi-Producer Single-Consumer via SPSC rings + doorbell futex.
std::span< const uint8_t > ring_receive_msg(SpscShm &ring, uint64_t timeout_ns)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::string to_string(bb::avm2::ValueTag tag)
Single-producer/single-consumer shared-memory ring buffer (Linux, x86-64 optimized)