Releases: swhitty/swift-timeout
Releases · swhitty/swift-timeout
0.4.1 Swift 6.2
0.4.0 Swift 6.2
What's Changed
- Support Swift 6.2 by @swhitty in #8
- Removes Swift 5 support
- use nonisolated(nonsending) in Swift 6.2 by @swhitty in #10
Full Changelog: 0.3.1...0.4.0
0.3.1 struct Timeout -> TimeoutController
What's Changed
Full Changelog: 0.3.0...0.3.1
0.3.0 AsyncTimeoutSequence
Rename swift-timeout
Renames package to swift-timeout you must now import Timeout.
Adds deadline when Clock is available:
import Timeout
let val = try await withThrowingTimeout(after: .now + .seconds(2)) {
try await perform()
}Rename swift-timeout
Renames package to swift-timeout you must now import Timeout.
Adds deadline when Clock is available:
import Timeout
let val = try await withThrowingTimeout(after: .now + .seconds(2)) {
try await perform()
}Initial Release
Usage is similar to using task groups:
let val = try await withThrowingTimeout(seconds: 1.5) {
try await perform()
}The provided closure is performed within a child task. If the timeout expires before a value is returned the task is cancelled and TimeoutError is thrown.