mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
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:
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)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user