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 8b78232
Showing 1 changed file with 3 additions and 1 deletion.
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 completeWithAsync(_ body: @escaping () async throws -> Value) -> Task<Void, Never> {
Task {
do {
let value = try await body()
Expand Down

0 comments on commit 8b78232

Please sign in to comment.