Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_NIOConcurrency: Rename completeWithAsync(_:) to completeWithTask(_:) and return task #1911

Merged
merged 6 commits into from
Aug 3, 2021
4 changes: 3 additions & 1 deletion Sources/_NIOConcurrency/AsyncAwaitSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ extension EventLoopPromise {
///
/// - parameters:
/// - body: The `async` function to run.
/// - returns: A `Task` which was created to `await` the `body`.
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
@discardableResult
@inlinable
public func completeWithAsync(_ body: @escaping () async throws -> Value) {
public func completeWithTask(_ body: @escaping () async throws -> Value) -> Task<Void, Never> {
glbrntt marked this conversation as resolved.
Show resolved Hide resolved
Task {
do {
let value = try await body()
Expand Down