diff --git a/Sources/_NIOConcurrency/AsyncAwaitSupport.swift b/Sources/_NIOConcurrency/AsyncAwaitSupport.swift index 02dbb9c51..8d6d05316 100644 --- a/Sources/_NIOConcurrency/AsyncAwaitSupport.swift +++ b/Sources/_NIOConcurrency/AsyncAwaitSupport.swift @@ -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 { Task { do { let value = try await body()