some more doc comments and minor formatting

This commit is contained in:
Gered 2016-05-09 17:49:42 -04:00
parent 333e4873d5
commit 4fbf7b7c7d
2 changed files with 18 additions and 8 deletions

View file

@ -21,6 +21,8 @@
(iasync/close channel))) (iasync/close channel)))
(defn wrap-immutant-async-adapter (defn wrap-immutant-async-adapter
"wraps the ring handler with an async adapter necessary for
browserchannel sessions."
[handler] [handler]
(fn [request] (fn [request]
(let [resp (handler request)] (let [resp (handler request)]
@ -35,7 +37,15 @@
resp)))) resp))))
(defn run-immutant [handler options] (defn run-immutant
"convenience function for wrapping a ring handler with the necessary
immutant async adapter and also starting up an immutant server
at the same time. many applications may want to just directly
use wrap-immutant-async-adapter instead and not use this function.
options is passed directly to immutant. see immutant.web/run
for a description of the available options."
[handler options]
(-> handler (-> handler
(wrap-immutant-async-adapter) (wrap-immutant-async-adapter)
(iweb/run options))) (iweb/run options)))