summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorDamien Neil <dneil@google.com>2023-04-05 16:06:36 -0700
committerDamien Neil <dneil@google.com>2023-04-19 19:13:01 +0000
commit54d429999c00f277c80b5698fb78c7b71f91aad9 (patch)
tree41aa26b0fde50281270f80f5e5fcf934e569d7b5 /api
parent9d53d7aa02a8e5fca52fb638116592b7f0b04823 (diff)
downloadgo-git-54d429999c00f277c80b5698fb78c7b71f91aad9.tar.gz
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>
Diffstat (limited to 'api')
-rw-r--r--api/next/57928.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/api/next/57928.txt b/api/next/57928.txt
new file mode 100644
index 0000000000..5b85e74cdb
--- /dev/null
+++ b/api/next/57928.txt
@@ -0,0 +1 @@
+pkg context, func AfterFunc(Context, func()) func() bool #57928