NIOExtras is a good place for code that is related to NIO but not core. It can also be used to incubate APIs for tasks that are possible with core-NIO but are cumbersome today.
What makes a good contribution to NIOExtras?
- a protocol encoder/decoder pair (also called "codec") that is often used but is small enough so it doesn't need its own repository
- a helper to achieve a task that is harder-than-necessary to achieve with core-NIO
Code Quality / Stability
All code will go through code review like in the other repositories related to the SwiftNIO project.
swift-nio-extras part of the SwiftNIO 2 family of repositories and depends on the following:
swift-nio, version 2.0.0 or better.
- Swift 5.0.
zliband its development headers installed on the system. But don't worry, you'll find
zlibon pretty much any UNIX system that can compile any sort of code.
To depend on
swift-nio-extras, put the following in the
dependencies of your
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.0.0"),
Support for older Swift versions
nio-extras-0.1 branch, you can find the
swift-nio-extras version for the SwiftNIO 1 family. It requires Swift 4.1 or better.
QuiescingHelper: Helps to quiesce a server by notifying user code when all previously open connections have closed.
ByteBuffers on line endings.
ByteBuffers by a fixed number of bytes.
ByteBuffers by a number of bytes specified in a fixed length header contained within the buffer.
LengthFieldPrependerPrepends the number of bytes to outgoing
ByteBuffers as a fixed length header. Can be used in a codec pair with the
RequestResponseHandlerMatches a request and a promise with the corresponding response.
HTTPResponseCompressorCompresses the body of every HTTP/1 response message.
DebugInboundsEventHandlerPrints out all inbound events that travel through the
DebugOutboundsEventHandlerPrints out all inbound events that travel through the
.pcapcontaining the traffic of the
ChannelPipelinethat you can inspect with Wireshark/tcpdump.
Help us keep the lights on
1.2.0 - Jul 22, 2019
- Added support for Content-Length based framing for JSON-RPC. (#53)
- Fixed issue where
LineBasedFrameDecoderwould not break correctly when receiving
- Added podspec. (#48, #50)
- Cleaned up README. (#47)
- Testing improvements. (#52)
1.1.0 - Jul 22, 2019
- Added the
NIOWritePCAPHandlerfor synthesised packet captures. (#46)
- Miscellaneous repo cleanups. (#42, #43)
1.0.0 - Apr 1, 2019
See our blog post announcing the release of the SwiftNIO 2 family.
0.1.2 - Sep 12, 2018
This release contains no code changes, and is exists purely for administrative purposes.
0.1.1 - Aug 15, 2018
- adds a line-based frame decoder that can split received buffers on line endings (#11)