Skip to content

Instantly share code, notes, and snippets.

@ztellman
Last active July 7, 2016 17:48
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 ztellman/c52765db0e739e8eec2b83cd68f319fb to your computer and use it in GitHub Desktop.
Save ztellman/c52765db0e739e8eec2b83cd68f319fb to your computer and use it in GitHub Desktop.
(require '[manifold.deferred :as d])
(defn wrap-async-handler [f]
(fn [req]
(let [rsp (d/deferred)]
(f req #(d/success! rsp %) #(d/error! rsp %))
rsp)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment