MCPcopy Create free account
hub / github.com/erpc/erpc / execStateFromCtx

Function execStateFromCtx

data/cache_executor.go:99–109  ·  view source on GitHub ↗

execStateFromCtx returns the per-request ExecState attached to the context, or nil when the cache layer is being driven outside a request lifecycle (e.g. background prefetch). Cache-scope counter increments are no-ops in that case.

(ctx context.Context)

Source from the content-addressed store, hash-verified

97// request lifecycle (e.g. background prefetch). Cache-scope counter
98// increments are no-ops in that case.
99func execStateFromCtx(ctx context.Context) *common.ExecState {
100 r := ctx.Value(common.RequestContextKey)
101 if r == nil {
102 return nil
103 }
104 req, ok := r.(*common.NormalizedRequest)
105 if !ok || req == nil {
106 return nil
107 }
108 return req.ExecState()
109}
110
111func (e *cacheExecutor) runRetry(
112 ctx context.Context,

Callers 2

runRetryMethod · 0.85
runHedgeBytesMethod · 0.85

Calls 2

ValueMethod · 0.80
ExecStateMethod · 0.80

Tested by

no test coverage detected