|
You are here |
konradreiche.com | ||
| | | | |
matttproud.com
|
|
| | | | | Pop quiz, hot shot: what is the behavior of func f (as defined below) when it is called from a bare gRPC method or HTTP handler as go f(ctx) using the context.Context provided to the handler?1 1 2 3 4 5 6 7 8 9 10 11 func f(ctx context.Context) { // Flimsily make it improbable for this function to continue while the // handler is serving. time.Sleep(time.Second) select { case <-time. | |
| | | | |
www.ardanlabs.com
|
|
| | | | | Introduction The Go programming language has the built-in keyword go to create goroutines, but has no keywords or direct support for terminating goroutines. In a real world service, the ability to time-out and terminate goroutines is critical for maintaining the health and operation of a service. No request or task can be allowed to run forever so identifying and managing latency is a responsibility every programmer has. A solution provided by the Go team to solve this problem is the Context package. | |
| | | | |
ghvsted.com
|
|
| | | | | The Go context package was developed to make it easy to pass request-scoped values, deadlines, and cancellation signals across API boundaries and processes. Thinking about Context in non-technical terms(?the circumstances that form the setting for an event, statement, or idea, and in terms of which it can be fully understood?) for a start could help us better understand Context as used technically. The context package comes in very handy when working with servers, making HTTP requests, and a host of othe... | |
| | | | |
laihoconsulting.com
|
|
| | | Website and personal blog of Pekka Laiho, software engineer and financial enthusiast. | ||