mirror of
https://github.com/golang/go
synced 2024-11-11 20:20:23 -07:00
54d429999c
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>
2 lines
64 B
Plaintext
2 lines
64 B
Plaintext
pkg context, func AfterFunc(Context, func()) func() bool #57928
|