1
0
mirror of https://github.com/golang/go synced 2024-11-11 20:20:23 -07:00
go/api/next/57928.txt
Damien Neil 54d429999c context: add AfterFunc
Add an AfterFunc function, which registers a function to run after
a context has been canceled.

Add support for contexts that implement an AfterFunc method, which
can be used to avoid the need to start a new goroutine watching
the Done channel when propagating cancellation signals.

Fixes #57928

Change-Id: If0b2cdcc4332961276a1ff57311338e74916259c
Reviewed-on: https://go-review.googlesource.com/c/go/+/482695
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Damien Neil <dneil@google.com>
Reviewed-by: Sameer Ajmani <sameer@golang.org>
2023-04-19 19:13:01 +00:00

2 lines
64 B
Plaintext

pkg context, func AfterFunc(Context, func()) func() bool #57928