Hi guys!
I have something that bothers me on this code: https://gist.github.com/jeans11/950a98fbda5c27c4091aaae0519f4ec4
I have multiple http request that want to launch in parallel. I use m/timeout to fix a timeout task to 500ms.
Sometimes the overall computation takes more than 500ms (like 700ms or +). I use time to see the duration of the task.
Did you see anything wrong?
what is your http client ?
clj-http
Small edit: I have try an other http client (`hato`) . Interesting behaviour happening. Sometimes the task hang forever. However when I remove the m/timeout and use the request timeout it works well and the global time is between 505 and 510ms.
I do not see any obvious mistake in your code. Hints :
• make sure there are no expensive calls in the ?request function
• instrument the task to measure the time between the future cancellation and the error callback - if there is a significant delay that's a clj-http issue
Thanks Leo for your feedback 🙏