missionary

J 2024-12-17T15:53:03.698419Z

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?

leonoel 2024-12-17T17:03:53.927969Z

what is your http client ?

J 2024-12-17T17:04:07.953309Z

clj-http

👍 1
J 2024-12-17T22:11:57.138849Z

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.

leonoel 2024-12-18T15:16:24.006709Z

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

J 2024-12-18T17:28:55.300629Z

Thanks Leo for your feedback 🙏