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

Remove conflicting copy of NIO method #141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,6 @@ import Tracing

private let millisecondsToNanoSeconds: UInt64 = 1000000

// Copy of extension from SwiftNIO; can be removed when the version in SwiftNIO removes its @available attribute
internal extension EventLoopFuture {
/// Get the value/error from an `EventLoopFuture` in an `async` context.
///
/// This function can be used to bridge an `EventLoopFuture` into the `async` world. Ie. if you're in an `async`
/// function and want to get the result of this future.
@inlinable
func get() async throws -> Value {
return try await withCheckedThrowingContinuation { cont in
self.whenComplete { result in
switch result {
case .success(let value):
cont.resume(returning: value)
case .failure(let error):
cont.resume(throwing: error)
}
}
}
}
}

public extension HTTPOperationsClient {
/**
Helper type that manages the state of a retriable async request.
Expand Down