Documentation
¶
Overview ¶
Example reconnect demonstrates AttachOptions.AutoReconnect with a custom backoff and an OnReconnect callback.
Usage:
go run ./examples/reconnect HOST BUSID
When the exporter restarts or the link flaps, the importer re- establishes the attach using an exponential backoff that caps at 30 seconds. Every retry is logged via the OnReconnect hook so operators can correlate with their own monitoring.
The program runs until SIGINT/SIGTERM. Detach on shutdown is the consumer's responsibility — this example chooses to Close() the Importer, which cancels every active port and drains the watcher.
Click to show internal directories.
Click to hide internal directories.