- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for ExampleWithCancel (0.12 sec)
-
src/context/example_test.go
// This example demonstrates the use of a cancelable context to prevent a // goroutine leak. By the end of the example function, the goroutine started // by gen will return without leaking. func ExampleWithCancel() { // gen generates integers in a separate goroutine and // sends them to the returned channel. // The callers of gen need to cancel the context once // they are done consuming generated integers not to leak
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Aug 21 20:24:28 UTC 2023 - 6.7K bytes - Viewed (0)