[go-nuts] Re: How do library functions that accept a context implement context cancellation inside?

2023-07-21 Thread Tamás Gulácsi
It depends. Checking the context (btw "if err := ctx.Err(); err != nil { return err }" is enough, no need for "select") is cheap but not free. So partition for reasonable sized chunks of work. Tamás Gurunandan Bhat a következőt írta (2023. július 21., péntek, 9:21:15 UTC+2): > Sorry - I meant

[go-nuts] Re: How do library functions that accept a context implement context cancellation inside?

2023-07-21 Thread Gurunandan Bhat
Sorry - I meant ..."calling select once per line" be a good point On Fri, Jul 21, 2023 at 12:41 PM Gurunandan Bhat wrote: > Hi, > > Are there any common patterns that standard and 3rd party library > functions use to implement cancelling a context passed to it? I have looked > at the source