Saturday, September 21, 2019

TeaPotServer

I wrote a TeaPotServer which is an HTTP2 server that uses Swift NIO under the hood. Swift NIO does the request, response handling with it event loop mechanism and the request processing is offloaded to GCD queue, making the event loop run as quick as possible without having to wait for a request to be processed. It's modelled as a REST API server with JSON as the main data exchange format. The server also has a logging component which conforms to SwiftLog API. The logging service uses the multiplexed logger to write to both file and console IO and does log rotation without missing any logs in the meantime. The main goal of the project is to demonstrate the development of a production server just by using Swift NIO and related libraries.