pushwire-client
Generic, multiplexed push client for real-time applications. Connects to a pushwire-server instance over WebSocket or SSE.
Part of the pushwire protocol family.
Features
PushClient<C>— generic over yourChannelKind, register per-channel receivers- WebSocket + SSE — configurable transport preference with automatic fallback
- Cursor tracking — per-channel cursors with gap detection for reliable delivery
- Auto-reconnect — exponential backoff with jitter, configurable retry limits, cursor-based resume
- Channel dispatch — implement
ChannelReceiverto handle frames per channel - Dynamic subscriptions — subscribe/unsubscribe to channels after connect
Quick start
use ;
// Define MyChannel implementing ChannelKind (see pushwire-core)
;
let config = new;
let mut client = new;
client.on;
client.connect.await.unwrap;
// Send a frame
client.send.await.unwrap;
// Graceful disconnect
client.disconnect.await.unwrap;
Reconnect policy
use ReconnectPolicy;
use Duration;
let policy = ReconnectPolicy ;
Set ReconnectPolicy::disabled() to turn off auto-reconnect.
Feature flags
rtc(default) — enables WebRTC signaling types viapushwire-core/rtc
License
Apache-2.0