Results for “cancellation”
Small, practical examples. Search by task or narrow things down below.
Observe cancellation through a token
C#: A cancellation token is cooperative; operations must check it or accept it as an argument.
C#✓ Tested
Observe context cancellation
Observe context cancellation using a complete Go program with explicit sample inputs.
Go✓ Tested
Increment an atomic counter
Increment an atomic counter using a complete Go program with explicit sample inputs.
Go✓ Tested
Initialize a resource only once
Initialize a resource only once using a complete Go program with explicit sample inputs.
Go✓ Tested
Protect a shared counter
Protect a shared counter using a complete Go program with explicit sample inputs.
Go✓ Tested
Queue values in a buffered channel
Queue values in a buffered channel using a complete Go program with explicit sample inputs.
Go✓ Tested
Range over a closed channel
Range over a closed channel using a complete Go program with explicit sample inputs.
Go✓ Tested
Receive a result from a goroutine
Receive a result from a goroutine using a complete Go program with explicit sample inputs.
Go✓ Tested
Try a channel receive without blocking
Try a channel receive without blocking using a complete Go program with explicit sample inputs.
Go✓ Tested
Wait for concurrent workers
Wait for concurrent workers using a complete Go program with explicit sample inputs.
Go✓ Tested