package http import ( "context" "net/http" ) type busyKey struct{} func Busy(r *http.Request) bool { b, _ := r.Context().Value(busyKey{}).(bool) return b } func busyRequest(r *http.Request) *http.Request { return r.WithContext(context.WithValue(r.Context(), busyKey{}, true)) } func MarkBusy(r *http.Request) *http.Request { return busyRequest(r) }