Skip to content

Commit

Permalink
_NIOConcurrency: Return Task from EventLoopPromise.completeWithAsync(_:)
Browse files Browse the repository at this point in the history
Signed-off-by: Si Beaumont <beaumont@apple.com>
  • Loading branch information
simonjbeaumont committed Jul 22, 2021
1 parent 9f7f17a commit 508011b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/_NIOConcurrency/AsyncAwaitSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ extension EventLoopPromise {
/// - parameters:
/// - body: The `async` function to run.
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
@discardableResult
@inlinable
public func completeWithAsync(_ body: @escaping () async throws -> Value) {
public func completeWithAsync(_ body: @escaping () async throws -> Value) -> Task<Void, Never> {
Task {
do {
let value = try await body()
Expand Down

0 comments on commit 508011b

Please sign in to comment.