onRetry


Description:

public Retry onRetry (owned RetryCallback fn)

Registers callback called before sleeping for next attempt.

This callback is useful for metrics, structured logs, and tracing.

Parameters:

fn

callback with attempt number, reason, and next delay millis.

Returns:

this retry instance.