TheClimateCorporation / squeedo

clojure core.async based amazon SQS message processing
Apache License 2.0
62 stars 28 forks source link

simple consumer middleware (#19) #28

Closed mtkp closed 7 years ago

mtkp commented 7 years ago

deserialization and timing middleware

tommy commented 7 years ago

I like the middleware approach. I think the timing middleware might be a little misleading though – if the caller is using squeedo as-advertised (in particular, writing to the done-channel in the callback to an async-IO request), using the wrap-time-logger middleware will log the time until that request was kicked off (not the total processing time for the message). In that case, the right place to measure latency is when the message is pulled back off the done-chan.

It's a useful middleware if the message processing is fully synchronous, but I worry if it's included in the lib that it won't do exactly what users think.

mtkp commented 7 years ago

thats a good point. i'll remove the timing middleware.