EmbeddedChannel: remove mystery bools (#917)

Motivation:

EmbeddedChannel.finish/writeInbound/writeOutbound returned some mystery
bools. I always had to check the code to remember what they actually
meaned.

Whilst this is technically a breaking change, I couldn't find any users
of the return values on Github that are using the convergence releases.

Modifications:

Replace them by enums giving you all the information.

Result:

- fixes #916
- clearer APIs
This commit is contained in:
Johannes Weiss authored and GitHub committed 2019-03-22 12:34:16 +00:00
1 parent 169f34adfc
commit a8fbcf080b
14 files changed
+168 -106

No files matched your search

+1
View File
@@ -86,4 +86,5 @@
- change `ChannelPipeline.addHandler(_:after:)` to `ChannelPipeline.addHandler(_:postion:)` where `position` can be `.first`, `.last`, `.before(ChannelHandler)`, and `.after(ChannelHandler)`
- Change `HTTPServerProtocolUpgrader` `protocol` to require `buildUpgradeResponse` to take a `channel` and return an `EventLoopFuture<HTTPHeaders>`.
- `EmbeddedChannel.writeInbound/Outbound` are now `throwing`
- `EmbeddedChannel.finish/writeInbound/writeOutbound` now return an `enum` representation of their effects rather than mystery bools.
- `HTTPMethod.hasRequestBody` and the `HTTPMethod.HasBody` type have been removed from the public API