metosin / sieppari

Small, fast, and complete interceptor library for Clojure/Script
Eclipse Public License 2.0
207 stars 21 forks source link

combine continue and catch in the async protocol #43

Closed dspiteself closed 3 years ago

dspiteself commented 4 years ago

Future and delay are significantly faster if we combine continue and catch in the protocol.

This pull request adds error handling to the responsibilities of continue. In order to do this well we must pass the context right before the the interceptor function is applied to continues signature.

dspiteself commented 4 years ago

It appears that there was a policy of allowing future values to be errors instead of always requiring exceptions to go down the exceptional path in the callback chain. I changed those tests, but if you think we should retains the old behavior it can be done pretty easy.