Hi all, I'm working on a new SDK for a database and wondering about community opinions on how to approach exposing timeouts for async operations?
- a) Implement timeout values on each operation and have the operations able to return timeout errors
- b) Leave it to the user to just drop the future whenever they want, which also better supports general cancellation.
From what I can see most libraries follow b. A large consideration to my mind is that even implementing a doesn't prevent users from doing b.
However, in other languages we attach valuable debugging information to timeout errors (like routing information, number of retries, for the operation etc...) and I don't see an obvious way to expose this information via b. Maybe detect the future is being dropped and write the operation context to a log?