Fork me on GitHub
#pedestal
<
2018-12-06
>
schmee09:12:57

what’s a good pattern to make requests in parallel in an interceptor chain?

schmee09:12:25

right now I have two interceptors that make outbound requests by attaching a future to the context and then returning immediately, but I’m wondering if there is a more idiomatic way

schmee09:12:07

does returning an asynchronous context help? my understanding is that even if the first interceptor returns an async context, the second one will still block until the first one is done

jaihindhreddy16:12:25

^ Using core.async perhaps?

martinklepsch17:12:53

Alright, classic middleware issue: at first I didn't call not-modified and somehow added the interceptor constructor function as an interceptor to the chain. Fixing that didn't immediately work but I then realized that the interceptor order was wrong, the etag was only set after the not-modified interceptor ran. 🙂

martinklepsch17:12:57

Problem solved 🙂

ccann19:12:52

has anyone ever gotten pedestal’s response-for to work with multipart-params? (ring-mw/multipart-params) as an interceptor doesn’t add the :form-params when using response-for to test, but works when actually hitting the server

ccann19:12:31

i’m not 100% sure but it almost looks like the content type gets explicitly overridden? https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/test.clj#L141