Problem
whisper recv reconnects on each invocation. For TUI or long-running scripts, this adds latency and wastes connections.
Solution
Add a daemon mode that maintains persistent relay connections:
# Start daemon (backgrounds, writes PID)
whisper daemon start
# Recv uses daemon's connection
whisper recv --via-daemon
# Stop daemon
whisper daemon stop
Implementation
- Daemon listens on Unix socket (e.g.,
$XDG_RUNTIME_DIR/whisper.sock)
- Maintains relay connections and subscriptions
- Clients connect to socket, request messages
- Daemon handles reconnection logic
Alternative: Simpler approach
Just add --persist flag to recv that reconnects automatically on disconnect:
whisper recv --persist # reconnects forever until SIGTERM
This may be sufficient for most use cases without full daemon complexity.
Problem
whisper recvreconnects on each invocation. For TUI or long-running scripts, this adds latency and wastes connections.Solution
Add a daemon mode that maintains persistent relay connections:
Implementation
$XDG_RUNTIME_DIR/whisper.sock)Alternative: Simpler approach
Just add
--persistflag to recv that reconnects automatically on disconnect:whisper recv --persist # reconnects forever until SIGTERMThis may be sufficient for most use cases without full daemon complexity.