Extended Class
EventLoopFuture
extension EventLoopFuture
Topics
Operators
&(_:_:)Returns the result of performing a bitwise AND operation on the two given futures&=(_:_:)Stores the result of performing a bitwise AND operation on the two given futures in the left-hand-side variable*(_:_:)Multiplies two futures and produces their product*=(_:_:)Multiplies two futures and stores the result in the left-hand-side variable+(_:_:)Adds two futures and produces their sum+=(_:_:)Adds two futures and stores the result in the left-hand-side variable-(_:_:)Subtracts one future from another and produces their difference-=(_:_:)Subtracts the second future from the first and stores the difference in the left-hand-side variable/(_:_:)Returns the quotient of dividing the first future by the second<(_:_:)Returns a Boolean value indicating whether the value of the first argument is less than that of the second argument^(_:_:)Returns the result of performing a bitwise XOR operation on the two given futures>(_:_:)Returns a Boolean value indicating whether the value of the first argument is greater than that of the second argument|(_:_:)Returns the result of performing a bitwise OR operation on the two given futures%(_:_:)Returns the remainder of dividing the first future by the second>=(_:_:)Returns a Boolean value indicating whether the value of the first argument is greater than or equal to that of the second argument<=(_:_:)Returns a Boolean value indicating whether the value of the first argument is less than or equal to that of the second argument%=(_:_:)Divides the first future by the second and stores the remainder in the left-hand-side variable/=(_:_:)Divides the first future by the second and stores the quotient in the left-hand-side variable|=(_:_:)Stores the result of performing a bitwise OR operation on the two given futures in the left-hand-side variable^=(_:_:)Stores the result of performing a bitwise XOR operation on the two given futures in the left-hand-side variable<<(_:_:)Returns the result of shifting a future’s binary representation the specified number of digits to the left>>(_:_:)Returns the result of shifting a future’s binary representation the specified number of digits to the right>>=(_:_:)Stores the result of shifting a future’s binary representation the specified number of digits to the right in the left-hand-side variable<<=(_:_:)Stores the result of shifting a future’s binary representation the specified number of digits to the left in the left-hand-side variable~(_:)Returns the result of performing a bitwise NOT operation on the given future
Instance Methods
flatMapAlways(file:line:_:)When the currentEventLoopFuturereceives any result, run the provided callback, which will provide a newEventLoopFuture. Essentially combines the behaviors of.always(_:)and.flatMap(file:line:_:).flatMapEach(on:_:)Calls a closure, which returns anEventLoopFuture, on each element in a sequence that is wrapped by anEventLoopFuture. No results from each future are expected.flatMapEachCompact(on:_:)Calls a closure, which returns anEventLoopFuture<Optional>, on each element in a sequence that is wrapped by anEventLoopFuture.flatMapEachCompactThrowing(_:)Calls a closure, which returns anOptional, on each element in the sequence that is wrapped by anEventLoopFuture.flatMapEachThrowing(_:)Calls a closure on each element in the sequence that is wrapped by anEventLoopFuture.guard(_:else:)Guards that the future’s value satisfies the callback’s condition or fails with the given error.mapEach(_:)Gets the value of a key path for each element in the sequence that is wrapped by anEventLoopFuture.mapEachCompact(_:)Gets the optional value of a key path for each element in the sequence that is wrapped by anEventLoopFuture.mapEachFlat(_:)Gets the collection value of a key path for each element in the sequence that is wrapped by anEventLoopFuture, combining the results into a single result collection.nonempty(orError:)Checks that the future’s value (if any) returnsfalsefor.isEmpty. If the check fails, the provided error is thrown.nonemptyFlatMap(_:)Checks that the future’s value (if any) returnsfalsefor.isEmpty. If the check fails, a new future with an empty array as its value is returned. Otherwise, the provided normalflatMap()callback is invoked. The callback’s returned future must have a value type that is anArrayor aRangeReplaceableCollection.nonemptyFlatMap(or:_:)Checks that the future’s value (if any) returnsfalsefor.isEmpty. If the check fails, a new future with the provided alternate value is returned. Otherwise, the provided normalflatMap()callback is invoked.nonemptyFlatMap(orFlat:_:)Checks that the future’s value (if any) returnsfalsefor.isEmpty. If the check fails, the provided alternate future is returned. Otherwise, the provided normalflatMap()callback is invoked.nonemptyFlatMapThrowing(_:)Checks that the future’s value (if any) returnsfalsefor.isEmpty. If the check fails, a new future with an empty array as its value is returned. Otherwise, the provided normalflatMapThrowing()callback is invoked. The callback’s return type must be anArrayor aRangeReplaceableCollection.nonemptyFlatMapThrowing(or:_:)Checks that the future’s value (if any) returnsfalsefor.isEmpty. If the check fails, a new future with the provided alternate value is returned. Otherwise, the provided normalflatMapThrowing()callback is invoked.nonemptyMap(_:)Checks that the future’s value (if any) returnsfalsefor.isEmpty. If the check fails, a new future with an empty array as its value is returned. Otherwise, the provided normalmap()callback is invoked. The callback’s return type must be anArrayor aRangeReplaceableCollection.nonemptyMap(or:_:)Checks that the future’s value (if any) returnsfalsefor.isEmpty. If the check fails, a new future with the provided alternate value is returned. Otherwise, the provided normalmap()callback is invoked.optionalFlatMap(_:)Calls a closure on an optional value in anEventLoopFutureif it exists.optionalFlatMapThrowing(_:)Calls a throwing closure on an optional value in anEventLoopFutureif it exists.optionalMap(_:)Calls a closure on an optional value that is wrapped in anEventLoopFutureif it exists.sequencedFlatMapEach(_:)An overload ofsequencedFlatMapEach(_:)which returns aVoidfuture instead of[Void]when the result type of the transform closure isVoid.sequencedFlatMapEachCompact(_:)Variant ofsequencedFlatMapEach(_:)which providescompactMap()semantics by allowing result values to benil. Such results are not included in the output array.transform(to:)Maps the current future to contain the new type. Errors are carried over, successful (expected) results are transformed into the given instance.tryFlatMap(file:line:_:)
Type Methods
whenTheySucceed(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 20.whenTheySucceed(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 19.whenTheySucceed(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 18.whenTheySucceed(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 17.whenTheySucceed(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 16.whenTheySucceed(_:_:_:_:_:_:_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 15.whenTheySucceed(_:_:_:_:_:_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 14.whenTheySucceed(_:_:_:_:_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 13.whenTheySucceed(_:_:_:_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 12.whenTheySucceed(_:_:_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 11.whenTheySucceed(_:_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 10.whenTheySucceed(_:_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 9.whenTheySucceed(_:_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 8.whenTheySucceed(_:_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 7.whenTheySucceed(_:_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 6.whenTheySucceed(_:_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 5.whenTheySucceed(_:_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 4.whenTheySucceed(_:_:_:file:line:)whenTheySucceed(_:_:file:line:)of order 3.whenTheySucceed(_:_:file:line:)Returns a newEventLoopFuturethat succeeds only if all of the provided fs succeed. The newEventLoopFuturewill contain all of the values fulfilled by the fs.