Skip to main content

pump_client

Function pump_client 

Source
pub fn pump_client(
    db: &AimDb,
    scheme: &str,
    handle: &ClientHandle,
) -> Vec<BoxFut<'static, ()>> ⓘ
Expand description

Mirror records between a local AimDb and a remote peer over a running run_client engine — the connector-link half of the client capability.

For the given connector scheme (e.g. "aimx"):

  • outbound routes (db.collect_outbound_routes) stream local record updates to the remote via ClientHandle::write;
  • inbound routes (db.collect_inbound_routes) subscribe to the remote and produce each update into the local record through the producer/arbiter path — single-writer-per-key stays intact (a mirrored-in record is produced through its inbound producer, never a direct co-writer). Mirroring is latest-state and best-effort — a gap the server reports (SubUpdate::skipped) is logged and stepped over, never backfilled.

Returns one spawn-free pump future per route for the runner to drive (mirroring the ConnectorBuilder::build -> Vec<BoxFuture> spine); it drives the same engine as run_client, never a second one.

Reconnect caveat: inbound pumps subscribe once and are not replayed across a reconnect (see ClientConfig::reconnect); outbound mirroring is unaffected.