News for hackers. Stuff that matters.
Re:Make resilient Go servers using timeouts, deadlines and c... by JyB on Sunday January 26, 2020 @12:29PM (#22153326)
In most cases, at the inner-most level you end up calling some sort of external library (sql, api-client, ...) that will handle the Done() channel itself.

All you have to do is make sure is to pass to the library the context that carries your timeout or cancellation signal. The "rule" that everyone seems to follow is to always take as first argument a context.Context if your library handles cancellation.

There are no comments on this comment yet.