forked from apple/swift-nio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'promise' versions of EventLoopFuture.{and,when}All{succeed,compl…
…ete} (apple#1794) Motivation: Most NIO APIs have two versions: one accepting a promise (often optional) and another which returns a future. Many applications and frameworks built on top of NIO also use this pattern. To maximise composability we should try to provide both versions where possible. Modifications: Add versions of `andAllSucceed`, `andAllComplete`, `whenAllSucceed` and `whenAllComplete` which accept an `EventLoopPromise` in place of an `EventLoop` and defer the implementation of the future versions to the promise versions. Result: - Better composability. - Fewer allocations if the caller already has a promise.
- Loading branch information
Showing
2 changed files
with
261 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.