run
Async entry point that connects to RELAY and runs the event loop until
interrupted. This is the recommended way to start a RelayClient for long-running
services. It calls connect()
internally and automatically reconnects with exponential backoff (1 second initial
delay, up to 30 seconds maximum) if the connection is lost.
The method awaits until shutdown is requested. Press Ctrl+C to trigger a clean shutdown —
the client handles SIGINT and SIGTERM gracefully.
For async contexts where you need manual control over the connection lifecycle,
use connect() and
disconnect() directly.
Parameters
None.
Returns
Promise<void> — resolves when the client is stopped via Ctrl+C or a programmatic shutdown.