A protocol that defines methods for making succeeded and failed futures.
public protocol Promisable
Creates a new succeeded future with value value
.
func makeSucceededFuture<T>(_ value: T) -> EventLoopFuture<T>
- value: The value to wrap in the future
An EventLoopFuture
that always succeeds with value
.
Creates a new failed future with error error
.
func makeFailedFuture<T>(_ error: Error) -> EventLoopFuture<T>
- error: The error to wrap in the future
An EventLoopFuture
that always fails with error
.