Skip to main content

Module async_bridge

Module async_bridge 

Source
Expand description

Async wrappers for the SPSC bridge.

These integrate the raw Producer/Consumer with Tokio’s async runtime and the eventfd-based waker, providing async fn push() and async fn pop().

§Architecture

Tokio (Control Plane)             TPC (Data Plane)
┌─────────────────────┐           ┌─────────────────────┐
│  AsyncProducer      │           │  SyncConsumer        │
│  .push(req).await   │──push──→  │  .poll_drain()       │
│                     │           │                     │
│  AsyncReceiver      │           │  SyncSender          │
│  .recv(rsp).await   │←──pop──── │  .try_send(rsp)      │
└─────────────────────┘           └─────────────────────┘

The TPC side uses SyncConsumer/SyncSender (non-async, !Send-compatible). The Tokio side uses AsyncProducer/AsyncReceiver which wrap try_push/try_pop with eventfd-based waking.

Structs§

BridgeChannel
A complete bridge channel: request path (Control→Data) + response path (Data→Control).
ControlHandle
Handle held by the Control Plane (Tokio).
DataHandle
Handle held by the Data Plane (TPC core).
PinnedDataHandle
A pinned Data Plane handle that is !Send.