Thanks to visit codestin.com
Credit goes to docs.rs

Skip to main content

Crate dwbase_swarm_nats

Crate dwbase_swarm_nats 

Source
Expand description

NATS-backed presence for DWBase components (hello/presence). This module provides a trait-based client with an in-memory mock bus suitable for tests or local runs.

Modules§

replication
swarm
world_events

Structs§

MockNats
In-memory broadcast bus for tests/local dev (not real NATS).
NodeHello
Presence announcement payload.
PeerInfo
Peer record with expiry.
PeerTable
Simple peer table with TTL expiry.

Traits§

NatsClient
Client trait so real or mock NATS can be plugged in.

Functions§

now_rfc3339
start_presence_loop
Periodically publish hello and feed the peer table.