Fork me on GitHub
#pedestal
<
2018-09-20
>
mavbozo09:09:39

but io.pedestal.interceptor/interceptor? returns false for interceptor like above

orestis09:09:24

interceptor? only checks for the type:

(defn interceptor?
  [o]
  (= (type o) Interceptor))

orestis09:09:15

You might want to use (satisfies? IntoInterceptor t) which is what io.pedestal.interceptor/interceptor uses to as a pre-condition.

mavbozo09:09:31

i tried to update to pedestal 0.5.4 from 0.5.3 and io.pedestal.interceptor.chain/enqueue threw AssertionError in my codebase because I enqueue hash-map based interceptor like my hello-world example above

orestis09:09:56

I guess you have to wrap attach-guid with a call to interceptor.

orestis09:09:25

so sth like (io.pedestal.interceptor.chain/enqueue ctx [(io.pedestal.interceptor/interceptor hello-world)])

orestis09:09:40

NB: I’m just looking at the source, I haven’t actually tried any of this 🙂

mavbozo09:09:19

yup, wrapping my hash-map based interceptor with i.p.i/interceptor works

mavbozo09:09:34

should we change io.pedestal.interceptor/interceptor? implementation to using (satisfies? IntoInterceptor t) so that the implementation correctly satisifies pedestal interceptor reference?