mirror of
https://github.com/apple/swift-nio
synced 2026-11-27 05:04:22 +00:00
EventLoopFuture: use Result type (#734)
Motivation: Now that the stdlib has introduced the Result type, we can use it in the implementation (and the whenComplete) function of EventLoopFuture Modifications: - replace EventLoopValue with Result - make whenComplete provide the Result Result: use the new shiny stuff
This commit is contained in:
1 parent
08eb3259ce
commit
684cad331c
21 files changed
+74
-86
No files matched your search
@@ -309,7 +309,7 @@ public final class WebSocketFrameDecoder: ByteToMessageDecoder {
|
||||
let frame = WebSocketFrame(fin: true,
|
||||
opcode: .connectionClose,
|
||||
data: data)
|
||||
ctx.writeAndFlush(self.wrapInboundOut(frame)).whenComplete {
|
||||
ctx.writeAndFlush(self.wrapInboundOut(frame)).whenComplete { (_: Result<Void, Error>) in
|
||||
ctx.close(promise: nil)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user