By Rachel Magruder

Clojurists Together News

Hello CT Community -

The second month of updates from Neanderthal and Aleph is here.

Thanks for your continued support of Clojurists Together!

I’ve spent quite a lot of time working through comments for previous PRs and keeping those changes in a mergable state. At the end of the day a few PRs made their way to master and I hope to see more following.

WebSockets

Issue with WebSocket per-message deflate extension handshaker turned out to be way more complex than I’ve expected. I had an idea to close the gap of inconsistent APIs on Netty’s side: “Decouple WebSocket server extension handshaker from read I/O“. But as these changes didn’t get through, I’m going to implement workaround in Aleph’s codebase.

Expose more information about handshake result both on the client and on the server, e.g. subprotocols and extensions #498.

WebSocket client handshake processing flow changes, #498. This change effectively reverts one of my old PRs with regards to how aggregated HTTP request is process when doing WebSocket handshake. Previously I thought that this approach leads to memory leaks, which turned out not to be the case. New implementation should be more performance and obviously has less memory overhead.

A few updates to WebSocket client force close after given timeout functionality submitted to Netty.

I also spent tons of hours investigating performance of netty/source and netty/sink in turms of latencies, throughput, backpressure. I was looking into Netty’s autoRead semantic, how Aleph deals with it and if we can improve performane oding flush on readComplete . To make story short: we can. In cases when you send/recieve a lot of small chunks. I’m still not sure how to expose this in the framework tho’. Talking about small chunks of data… I did the same investigation for UDP.

Files

#497 Use HttpUtil to manage “Content-Length” header, small internal improvement.

Even more fixes for Keep-Alive connections management for Netty’s examples, I think it makes sense to refactor part of the Aleph and move Keep-Alive logic into a separate channel handler so I would be easier to extend/fix (e.g. to close the connection after the error response).

Nasus (static files server) got a few more features: CORS headers, symlics support, Basic Auth.

Performance

HTTP client timeouts were reimplemented with HashedWheelTimer s that are designed specifically to handler tons of I/O events, #499. That’s a huge performance improvement for projects with higher RPS rates. The reasons for that were described in #479, thanks to Alexander Yakushev for brining this up.

MQTT

I’ve started this as an experiment.. but now part of client-side logic is implemented: connect/disconnect logic, publish messages to topics, acknowledgements flow for at least once QoS level. There’re still a lot of things missing but end-to-end example already works. I hope I’ll manage to pack those into a separate PR pretty soon.

Stay tuned!