mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Rename ELF.andAll(_:eventLoop:) to andAllSucceed(_🔛) and add ELF.andAllComplete (#803)
Motiviation: After adding `ELF.whenAllComplete` the concept of "fail fast" and "fail slow" for reducing an array of future results together was introduced. This commit adds that concepts with the `andAll* methods that act as simple completion notifications. Modifications: Rename `EventLoopFuture.andAll(_:eventLoop:)` to `andAllSucceed(_🔛)` to denote its "fail fast" nature, and to match Swift API guidelines. Add new `EventLoopFuture.andAllComplete(_🔛)` for a "fail slow" companion. Shift implementation of `whenAllComplete(_🔛)` to be usable without unnecessary allocations in `andAllComplete` Result: EventLoopFuture now has two methods for "flattening" arrays of EventLoopFuture into a single notification ELF
This commit is contained in:
1 parent
c6c137cde4
commit
06fb45d07e
12 files changed
+97
-56
No files matched your search
@@ -249,7 +249,7 @@ public class HTTPServerUpgradeHandler: ChannelInboundHandler {
|
||||
return ctx.eventLoop.makeSucceededFuture(())
|
||||
}
|
||||
|
||||
return EventLoopFuture<Void>.andAll(self.extraHTTPHandlers.map { ctx.pipeline.remove(handler: $0).map { (_: Bool) in () }},
|
||||
eventLoop: ctx.eventLoop)
|
||||
return .andAllSucceed(self.extraHTTPHandlers.map { ctx.pipeline.remove(handler: $0).map { (_: Bool) in () }},
|
||||
on: ctx.eventLoop)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user