Skip to content

Releases: swhitty/swift-timeout

Rename swift-timeout

08 Sep 21:49
f649c4e
Compare
Choose a tag to compare

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

08 Sep 10:12
df40fd6
Compare
Choose a tag to compare

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

01 Sep 08:24
17051a9
Compare
Choose a tag to compare

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.