Skip to content

Instantly share code, notes, and snippets.

@tobias

tobias/async.clj Secret

Created January 19, 2015 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobias/95d9f38b6960bdd2c433 to your computer and use it in GitHub Desktop.
Save tobias/95d9f38b6960bdd2c433 to your computer and use it in GitHub Desktop.
* `:on-close` - `(fn [ch {:keys [reason code message]}] ...)` -
called for *any* close, including a call to [[close]], but will only
be invoked once.
`reason` will be one of:
* :complete - the channel was closed normally
* :gone - the client disappeared
* :error - an error occured that forced closure
* :shutdown - the client or server is shutting down (WebSocket only)
* :other - some other unknown reason (WebSocket only)
`code` will be the numeric closure code if the channel is a
WebSocket, and can be inspected if you need more granularity
that provided by `reason`.
`message` will be the optional text for the closure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment