What’s context in Go

tags: learning go programming

content

scenario:

  • server receives an http request
  • server spawns a few go routines to process the request
  • these go routines need to way to communicate with each other (passing request-scoped values etc)
  • if the http request is cancel by client, a cancellation signal should be sent to cancel all go routines that’s processing the request

up

down

reference