Retrier

open class Retrier : @unchecked Sendable, RequestInterceptor

Closure-based RequestRetrier.

  • Creates an instance using the provided closure.

    Declaration

    Swift

    @preconcurrency
    public init(_ retryHandler: @escaping RetryHandler)

    Parameters

    retryHandler

    RetryHandler closure to be executed when handling request retry.

  • Declaration

    Swift

    @preconcurrency
    open func retry(_ request: Request,
                    for session: Session,
                    dueTo error: any Error,
                    completion: @escaping @Sendable (RetryResult) -> Void)