Fork me on GitHub
#reitit
<
2020-06-18
>
kirill.salykin15:06:30

goodmorning sorry for offtopic question - what is the best place to ask about compojure-api? (didnt find #compojure-api or #metosin channel)

valtteri15:06:39

Maybe here or #ring-swagger

kirill.salykin17:06:37

ok, the question is: I’d like to use compojure-api async with aleph, it is mentioned that I need some manuak staff to implement - but what exactly? is having just middleware to connect aleph and async-ring

(defn wrap-ring-async-handler
  "Converts given asynchronous Ring handler to Aleph-compliant handler.
   More information about asynchronous Ring handlers and middleware:
   "
  [handler]
  (fn [request]
    (let [response (d/deferred)]
      (handler request #(d/success! response %) #(d/error! response %))
      response)))
enough? or something else is needed? thanks UPD: seems to work fine with just that middleware, thanks