Skip to content

Instantly share code, notes, and snippets.

@jcrossley3
Created January 15, 2015 17:59
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 jcrossley3/c284e951078cd521f77e to your computer and use it in GitHub Desktop.
Save jcrossley3/c284e951078cd521f77e to your computer and use it in GitHub Desktop.
([handler {:keys [on-open on-close on-message on-error] :as callbacks}]
(fn [request]
(if (:websocket? request)
{:status 200 :body (initialize-websocket request callbacks)}
(if handler
(handler request)
{:status 200 :body (initialize-stream request callbacks)}))))
([callbacks]
(as-channel nil callbacks))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment