Releases: swhitty/Awaiting
Releases · swhitty/Awaiting
Swift 6 Language Mode
-
Adopts Swift 6 language mode when using Swift 6 compiler
-
Uses Swift Testing when available (Swift 6 compiler)
-
Updates internal lock to swift-mutex.
-
Drops support for Swift 5.8 and earlier. Swift 5.9 is now the minimum support compiler.
Element where predicate passes
Adds new method to wrapped Collection
where an element passes a predicate
@Awaiting var numbers = [Int]()
// suspends until a multiple of 7 is appended to the array e.g. `numbers.append(21)`
let value: Int = try await $numbers.element(where: { $0.isMultiple(of: 7) })
Equatable Waiter
Adds a specialized waiters for Equatable
elements:
@Awaiting var name: String?
// Suspends until name == "Fish"
try await $name.equals("Fish")
Modify
@Awaiting.Waiter is Sendable
@Awaiting.Waiter
is threadsafe and should be Sendable
Swift 5.7
Specialized Waiter
Adds some specialized waiters for collections and optionals:
@Awaiting var name: String?
// Suspends until name != nil
let name = try await $name.some()
@Awaiting var entries = [String]()
// Suspends until entries[2] exists
let entry = try await $entries.value(at: 2)
Initial Release
0.1.0