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
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