Remove EmbeddedChannel restriction to IOData (#763)

Remove EmbeddedChannel restriction to IOData

Motivation:

You should be able to read any type from the outbound buffer.

Modifications:

Change Embedded channel outboundBuffer and pendingOutboundBuffer to store NIOAny instead of IOData and refactor test code accordingly.

Result:

- Users can test what went through the pipeline without serializing everything and using "if case let" syntax everywhere.
- fixes #551
This commit is contained in:
JovanMilenkovic authored and Johannes Weiss committed 2019-01-30 19:24:59 +00:00
1 parent 70c714a54d
commit cf56bfd119
15 files changed
+89 -123

No files matched your search

@@ -19,7 +19,7 @@ import NIOWebSocket
extension EmbeddedChannel {
func readAllOutboundBuffers() -> ByteBuffer {
var buffer = self.allocator.buffer(capacity: 100)
while case .some(.byteBuffer(var writtenData)) = self.readOutbound() {
while var writtenData = self.readOutbound(as: ByteBuffer.self) {
buffer.write(buffer: &writtenData)
}