mirror of
https://github.com/apple/swift-async-algorithms
synced 2026-11-24 04:17:52 +00:00
* Add shims and adjust availability to allow for swift 5.6 toolchains to build until source stability is achieved * Restore availability again
24 lines
876 B
Swift
24 lines
876 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
extension Task where Success == Never, Failure == Never {
|
|
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
|
|
@_disfavoredOverload
|
|
public static func sleep<C: Clock>(
|
|
until deadine: C.Instant,
|
|
tolerance: C.Instant.Duration? = nil,
|
|
clock: C
|
|
) async throws {
|
|
try await clock.sleep(until: deadine, tolerance: tolerance)
|
|
}
|
|
}
|