Yeah they aren't treating http client as a fully baked API. We are using core Async API for timeouts. Works well. You can always do blocking read from core Async API so convert back to blocking with timeout
For aws-api, (how) can I specify http timeouts? Are there any defaults?
Well, I would really like to avoid core.async API. Besides, that doesn't set proper network socket timeouts, which is what I want to do.
I found :timeout-msec option for HttpClient protocol https://github.com/cognitect-labs/aws-api/blob/1a27e1e466e2f999cdd00d1738426f3d3c68e1e9/src/cognitect/aws/http.clj#L26
Would I need to implement my own http client?
There's probably a timeout in the bundled http client you can use also
I'm afraid I don't know how to specify/use that.
My best guess is that I would have to create my own instance via cognitect.http-client/create and pass the expected timeouts.
https://github.com/tobias/cognitect-http-client/blob/main/src/cognitect/http_client.clj#L318-L319 look sensible;
however I don't see the :socket-timeout option 😮
Yep. Use :http-client option when creating client
I also found this: https://github.com/cognitect-labs/aws-api/issues/41
(unfortunately, no progress in 5 years 😞 )
You could I interpret that as indicating that core.async is how you customise client
That just doesn’t make sense to me. It’s overly complicated and doesn’t address the problem properly (setting timeouts on network sockets)
Ok. The other option is no cognitect wrapper but instead interop with AWS java API. That will have a alternative client timeout to explore
After that, I'm out of ideas
Using the core.async API you can use alts and timeout channels to implement client timeout