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:
Johannes Weiss authored and Cory Benfield committed 2019-01-05 08:08:47 +00:00
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)
}
}