Skip to content

Commit 0c04331

Browse files
committed
Fix Linux compile error
1 parent 70385ac commit 0c04331

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

Tests/SotoTests/test.swift

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,11 @@
1414

1515
import Dispatch
1616
import Foundation
17+
import NIOCore
1718
@testable import SotoCore
1819
import XCTest
1920

20-
extension EventLoopFuture {
21-
/// When EventLoopFuture has any result the callback is called with the Result. The callback returns an EventLoopFuture<>
22-
/// which should be completed before result is passed on
23-
func flatAlways<NewValue>(file: StaticString = #file, line: UInt = #line, _ callback: @escaping (Result<Value, Error>) -> EventLoopFuture<NewValue>) -> EventLoopFuture<NewValue> {
24-
let next = eventLoop.makePromise(of: NewValue.self)
25-
self.whenComplete { result in
26-
switch result {
27-
case .success:
28-
callback(result).cascade(to: next)
29-
case .failure(let error):
30-
_ = callback(result).always { _ in next.fail(error) }
31-
}
32-
}
33-
return next.futureResult
34-
}
35-
}
36-
37-
@available(*, noasync, message: "runAndWait() can block indefinitely")
21+
@available(*, noasync, message: "runThrowingTask() can block indefinitely")
3822
func runThrowingTask<T>(on eventLoop: EventLoop, _ task: @escaping @Sendable () async throws -> T) throws -> T {
3923
let promise = eventLoop.makePromise(of: T.self)
4024
Task {
@@ -48,7 +32,7 @@ func runThrowingTask<T>(on eventLoop: EventLoop, _ task: @escaping @Sendable ()
4832
return try promise.futureResult.wait()
4933
}
5034

51-
@available(*, noasync, message: "runAndWait() can block indefinitely")
35+
@available(*, noasync, message: "runTask() can block indefinitely")
5236
func runTask<T>(on eventLoop: EventLoop, _ task: @escaping @Sendable () async -> T) -> T {
5337
let promise = eventLoop.makePromise(of: T.self)
5438
Task {

0 commit comments

Comments
 (0)