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 return while the // handler is serving. time.Sleep(time.Second) select { case <-time.After(5 * time.Second): log.Println("5s") case <-ctx.Done(): log.Println("canceled") } } Where the handlers look like this:
No pages have linked to this URL yet.