Releases: ANSCoder/AsyncGuardKit
1.0.0
AsyncGuardKit 1.0.0
Structured task lifetime management for Swift concurrency.
What's included
AsyncTask — Wrap async work with an explicit lifetime strategy. Choose .bind(to:), .store(in:), or .detached() at the call site. Tasks that reach deinit without a declared strategy cancel defensively.
AsyncLifetime — Bind tasks to an object's lifecycle. All bound tasks cancel automatically when the lifetime deallocates. Zero deinit code required.
withSingleFlight(key:operation:) — Deduplicate concurrent async operations by key. One execution runs, all callers receive the same result. Actor-backed, type-safe, no force casts.
retry(attempts:backoff:shouldRetry:operation:) — Cancellation-aware retry with .none, .fixed, and .exponential backoff strategies.
AsyncGuard.configure(_:) — Enable structured os.Logger diagnostics in debug builds. Zero overhead in release.
Requirements
| Platform | Minimum |
|---|---|
| iOS | 16.0 |
| macOS | 13.0 |
| tvOS | 16.0 |
| watchOS | 9.0 |
| Swift | 5.9 |
Installation
.package(url: "https://github.com/ANSCoder/AsyncGuardKit", from: "1.0.0")