Robin Heggelund Hansen
2015-02-23 00:47:21 UTC
I'm trying to get netty to gzip my responses to the client. This is what
I've tried so far.
(defn- pipeline-modifier [pipeline]
(doto pipeline
(.addLast "gzip" (HttpContentCompressor.))))
(defrecord Server [port routes db]
component/Lifecycle
(start [self]
(log/info "Starting server")
(if (:stop-fn self)
self
(let [handler (multimethod-handler db routes)]
(assoc self :stop-fn (http/start-server handler {:port port
:executor :none
:pipeline-transform pipeline-modifier})))))
(stop [self]
(log/info "Shutting down server")
(if-let [stop (:stop-fn self)]
(.close stop))
(dissoc self :stop-fn)))
What am I doing wrong?
By the way, I know I have been asking many questions lately. I just want to
end this question with some praise. Aleph is a really nice library, keep up
the good work!
I've tried so far.
(defn- pipeline-modifier [pipeline]
(doto pipeline
(.addLast "gzip" (HttpContentCompressor.))))
(defrecord Server [port routes db]
component/Lifecycle
(start [self]
(log/info "Starting server")
(if (:stop-fn self)
self
(let [handler (multimethod-handler db routes)]
(assoc self :stop-fn (http/start-server handler {:port port
:executor :none
:pipeline-transform pipeline-modifier})))))
(stop [self]
(log/info "Shutting down server")
(if-let [stop (:stop-fn self)]
(.close stop))
(dissoc self :stop-fn)))
What am I doing wrong?
By the way, I know I have been asking many questions lately. I just want to
end this question with some praise. Aleph is a really nice library, keep up
the good work!
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.