some more doc comments and minor formatting
This commit is contained in:
parent
333e4873d5
commit
4fbf7b7c7d
|
@ -21,6 +21,8 @@
|
|||
(iasync/close channel)))
|
||||
|
||||
(defn wrap-immutant-async-adapter
|
||||
"wraps the ring handler with an async adapter necessary for
|
||||
browserchannel sessions."
|
||||
[handler]
|
||||
(fn [request]
|
||||
(let [resp (handler request)]
|
||||
|
@ -35,7 +37,15 @@
|
|||
|
||||
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
|
||||
(wrap-immutant-async-adapter)
|
||||
(iweb/run options)))
|
||||
|
|
|
@ -196,13 +196,13 @@
|
|||
:on-sent (fn [delivered] ...)
|
||||
:on-error (fn [error-code] ...)
|
||||
|
||||
:on-open is called when a connection is (re-)established.
|
||||
:on-close is called when a connection is closed.
|
||||
:on-receive is called when data is received from the server.
|
||||
:on-sent is called when data has been successfully sent to
|
||||
the server ('delivered' is a list of what was sent).
|
||||
:on-error is only invoked once just before the connection is
|
||||
closed, and only if there was an error."
|
||||
:on-open is called when a connection is (re-)established.
|
||||
:on-close is called when a connection is closed.
|
||||
:on-receive is called when data is received from the server.
|
||||
:on-sent is called when data has been successfully sent to
|
||||
the server ('delivered' is a list of what was sent).
|
||||
:on-error is only invoked once just before the connection is
|
||||
closed, and only if there was an error."
|
||||
[handler & [options]]
|
||||
(let [options (merge default-options options)]
|
||||
(events/listen js/window "unload" #(disconnect!))
|
||||
|
|
Reference in a new issue