reconnect

command
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL