Skip to content

Latest commit

 

History

History
41 lines (24 loc) · 726 Bytes

Promisable.md

File metadata and controls

41 lines (24 loc) · 726 Bytes

Promisable

A protocol that defines methods for making succeeded and failed futures.

public protocol Promisable

Requirements

makeSucceededFuture(_:​)

Creates a new succeeded future with value value.

func makeSucceededFuture<T>(_ value: T) -> EventLoopFuture<T>

Parameters

  • value: The value to wrap in the future

Returns

An EventLoopFuture that always succeeds with value.

makeFailedFuture(_:​)

Creates a new failed future with error error.

func makeFailedFuture<T>(_ error: Error) -> EventLoopFuture<T>

Parameters

  • error: The error to wrap in the future

Returns

An EventLoopFuture that always fails with error.