func always(@escaping (Result<Value, Error>) -> Void) -> EventLoopFuture<Value>.Isolated
Adds an observer callback to this EventLoopFuture
that is called when the EventLoopFuture
has any result.
func flatMap<NewValue>(@escaping (Value) -> EventLoopFuture<NewValue>) -> EventLoopFuture<NewValue>.Isolated
When the current EventLoopFuture<Value>
is fulfilled, run the provided callback, which will provide a new EventLoopFuture
.
func flatMapError(@escaping (Error) -> EventLoopFuture<Value>) -> EventLoopFuture<Value>.Isolated
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 flatMapErrorThrowing(@escaping (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 flatMapThrowing<NewValue>(@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>(@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 nonisolated() -> EventLoopFuture<Value>
Returns the wrapped event loop future.
func recover(@escaping (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: @escaping () -> NewValue) -> EventLoopFuture<NewValue>.Isolated
Unwrap an EventLoopFuture
where its type parameter is an Optional
.
func unwrap<NewValue>(orReplace: NewValue) -> EventLoopFuture<NewValue>.Isolated
Unwrap an EventLoopFuture
where its type parameter is an Optional
.
func whenComplete(@escaping (Result<Value, Error>) -> Void)
Adds an observer callback to this EventLoopFuture
that is called when the EventLoopFuture
has any result.
func whenFailure(@escaping (Error) -> Void)
Adds an observer callback to this EventLoopFuture
that is called when the EventLoopFuture
has a failure result.
func whenSuccess(@escaping (Value) -> Void)
Adds an observer callback to this EventLoopFuture
that is called when the EventLoopFuture
has a success result.