nonisolated
Returns the wrapped event loop future.
func nonisolated() -> EventLoopFuture<Value> Returns the wrapped event loop future.
func nonisolated() -> EventLoopFuture<Value> s7NIOCore15EventLoopFutureC8IsolatedV11nonisolatedACyxGyF What are these?20DVPimport NIOCoreThe core abstractions that make up SwiftNIO.
struct IsolatedA struct wrapping an EventLoopFuture that ensures all calls to any method on this struct are coming from the event loop of the future.
final class EventLoopFuture<Value>Holder for a result that will be provided later.
func always(_ callback: @escaping (Result<Value, any Error>) -> Void) -> EventLoopFuture<Value>.Isolated Adds an observer callback to this EventLoopFuture that is called when the EventLoopFuture has any result.
func flatMap<NewValue>(_ callback: @escaping (Value) -> EventLoopFuture<NewValue>) -> EventLoopFuture<NewValue>.Isolated where NewValue : Sendable When the current EventLoopFuture<Value> is fulfilled, run the provided callback, which will provide a new EventLoopFuture.
func flatMapError(_ callback: @escaping (any Error) -> EventLoopFuture<Value>) -> EventLoopFuture<Value>.Isolated where Value : Sendable When the current EventLoopFuture<Value> is in an error state, run the provided callback, which may recover from the error by returning an EventLoopFuture<NewValue>. The callback is intended to potentially recover from the error by returning a new EventLoopFuture that will eventually contain the recovered result.
func flatMapError(_ callback: @escaping (any Error) -> EventLoopFuture<Value>.Isolated) -> EventLoopFuture<Value>.Isolated When the current EventLoopFuture<Value>.Isolated is in an error state, run the provided callback, which may recover from the error by returning an EventLoopFuture<NewValue>.Isolated. The callback is intended to potentially recover from the error by returning a new EventLoopFuture.Isolated that will eventually contain the recovered result.
func flatMapErrorThrowing(_ callback: @escaping (any Error) throws -> Value) -> EventLoopFuture<Value>.Isolated When the current EventLoopFuture<Value> is in an error state, run the provided callback, which may recover from the error and returns a new value of type Value. The provided callback may optionally throw, in which case the EventLoopFuture will be in a failed state with the new thrown error.
func flatMapResult<NewValue, SomeError>(_ body: @escaping (Value) -> Result<NewValue, SomeError>) -> EventLoopFuture<NewValue>.Isolated where SomeError : Error When the current EventLoopFuture<Value> is fulfilled, run the provided callback, which performs a synchronous computation and returns either a new value (of type NewValue) or an error depending on the Result returned by the closure.
func flatMapThrowing<NewValue>(_ callback: @escaping (Value) throws -> NewValue) -> EventLoopFuture<NewValue>.Isolated When the current EventLoopFuture<Value> is fulfilled, run the provided callback, which performs a synchronous computation and returns a new value of type NewValue. The provided callback may optionally throw.
func map<NewValue>(_ callback: @escaping (Value) -> NewValue) -> EventLoopFuture<NewValue>.Isolated When the current EventLoopFuture<Value> is fulfilled, run the provided callback, which performs a synchronous computation and returns a new value of type NewValue.
func recover(_ callback: @escaping (any Error) -> Value) -> EventLoopFuture<Value>.Isolated When the current EventLoopFuture<Value> is in an error state, run the provided callback, which can recover from the error and return a new value of type Value. The provided callback may not throw, so this function should be used when the error is always recoverable.
func unwrap<NewValue>(orElse callback: @escaping () -> NewValue) -> EventLoopFuture<NewValue>.Isolated where Value == NewValue? Unwrap an EventLoopFuture where its type parameter is an Optional.
func unwrap<NewValue>(orReplace replacement: NewValue) -> EventLoopFuture<NewValue>.Isolated where Value == NewValue? Unwrap an EventLoopFuture where its type parameter is an Optional.
func whenComplete(_ callback: @escaping (Result<Value, any Error>) -> Void) Adds an observer callback to this EventLoopFuture that is called when the EventLoopFuture has any result.
func whenFailure(_ callback: @escaping (any Error) -> Void) Adds an observer callback to this EventLoopFuture that is called when the EventLoopFuture has a failure result.
func whenSuccess(_ callback: @escaping (Value) -> Void) Adds an observer callback to this EventLoopFuture that is called when the EventLoopFuture has a success result.