pedestal

vemv 2020-03-03T03:14:00.011400Z

we use it with Component at work, and it works quite well. This is our wrapper: https://github.com/nedap/components.pedestal . it has some custom idioms like those kws namespaces but it could be forked if deemed too weird. (btw, since we prefer defn to defrecord, the code might be salvaged for Integrant) In general Pedestal can be a bit picky about "reloaded workflow" integration and accomplishing it has given me occasional headaches.

isak 2020-03-03T16:46:40.015100Z

Are these docs still correct about early termination happening if an interceptor in the chain returns a response map? http://pedestal.io/reference/servlet-interceptor#_early_termination For me it doesn't work - it still executes later interceptors

isak 2020-03-03T16:52:58.015900Z

Here is my interceptor that I expected would lead to early termination (but doesn't) based on that documentation:

(def test-interceptor
  {:name ::test-interceptor
   :enter
   (fn [ctx]
     (log/info :msg "Enter test-interceptor")
     (assoc ctx :response {:status 200 :body "test"}))
   :leave (fn [ctx]
            (log/info :msg "leave test-interceptor")
            ctx)})

isak 2020-03-03T16:59:35.016500Z

Ah, it didn't work because it also needed :headers :

(defn response?
  "True if the supplied value is a valid response map."
  {:added "1.1"}
  [resp]
  (and (map? resp)
       (integer? (:status resp))
       (map? (:headers resp))))