Retry Configuration - bharat-1809/wizctl GitHub Wiki

Retry Configuration

Configure retry behavior for network requests.

RetryConfig.none()                                                    // Single attempt
RetryConfig.fixed(count: 5, interval: Duration(seconds: 1))          // Fixed intervals
RetryConfig.exponential(count: 5, initialInterval: Duration(ms: 500)) // Backoff

Strategies

Fixed — retries at regular intervals (good for discovery where timing is predictable).

Exponential — interval doubles after each retry, capped at maxInterval. Reduces network load over time.

500ms → 1s → 2s → 3s → 3s (capped)

Usage

await WizDiscovery.discover(
  retry: RetryConfig.fixed(count: 5, interval: Duration(seconds: 1)),
);

await WizDiscovery.discover(
  retry: RetryConfig.exponential(
    count: 5,
    initialInterval: Duration(milliseconds: 500),
    maxInterval: Duration(seconds: 3),
  ),
);