Skip to content

Structure

RetryPolicy

Defines retry behavior with exponential backoff for transient failures.

struct RetryPolicy

Overview

Use RetryPolicy to wrap any throwing async operation with automatic retry logic. Each successive attempt waits longer before retrying (exponential backoff).

Usage

let policy = RetryPolicy(maxAttempts: 3, initialDelay: .seconds(1), multiplier: 2.0)
let result = try await policy.execute {
    try await uploadChunk(data: data)
}

Topics

Instance Properties

Instance Methods

Relationships

Conforms To

  • Swift.Sendable
  • Swift.SendableMetatype