Swiftpack.co -  hummingbird-project/hummingbird-compression as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
hummingbird-project/hummingbird-compression
Compression support for Hummingbird server framework
.package(url: "https://github.com/hummingbird-project/hummingbird-compression.git", from: "0.4.0")

Hummingbird Compression

Adds request decompression and response compression to Hummingbird

Usage

let app = HBApplication()
// run response compression on application thread pool when buffer is 
// larger than 32768 bytes otherwise run it on the eventloop
app.addResponseCompression(execute: .onThreadPool(threshold: 32768))
// run request decompression on eventloop with no limit to the size
// of data that can be decompressed
app.addRequestDecompression(execute: .onEventLoop, limit: .none)

Adding request decompression means when a request comes in with header content-encoding set to gzip or deflate the server will attempt to decompress the request body. Adding response compression means when a request comes in with header accept-encoding set to gzip or deflate the server will compression the response body.

GitHub

link
Stars: 2
Last commit: 4 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Release Notes

v0.4.0
4 weeks ago
  • Add option to run compression/decompression on either thread pool or EventLoop.
  • Fix setting of state in channel handlers so state is set before passing data onto next handler.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API