My team is working on a proxy server that will have to read GZIP encoded responses and respond to some requests with GZIP encoded responses. Since there is nothing built in, we will roll our own. The idea is to implement a decorator for ReadStream and WriteStream that install a handler that does the de/encoding. The question came up whether doing the encoding/decoding on the event thread is appropriate since it will busy the thread. I maintain that the event thread is the place to the work being done for compression and is akin to the work being done for SSL encryption. Another alternative is to pass the content to a BusMod do the gzip there, then send the result back to the main verticle - this seems overly complicated and inefficient.
I imagine someone has done this before in Vertx (I've seen some posts on it) and I'd like to hear opinions on the topic and any lessons learned.
BTW: This seems like a common enough thing to do, it behooves Vertx to have an official way to do this, be it some utility classes that wrap a Read/Write Stream, or at least an official recommendation on how to do it.
Thanks in advance for your thoughts.