MCPcopy Create free account
hub / github.com/cel-expr/cel-go / Exec

Method Exec

interpreter/async.go:98–120  ·  view source on GitHub ↗

Exec implements the InterpretableV2 interface method.

(frame *ExecutionFrame)

Source from the content-addressed store, hash-verified

96
97// Exec implements the InterpretableV2 interface method.
98func (fn *evalAsyncFunc) Exec(frame *ExecutionFrame) ref.Val {
99 argVals := make([]ref.Val, len(fn.args))
100 var unk *types.Unknown
101 for i, arg := range fn.args {
102 argVals[i] = arg.Exec(frame)
103 if types.IsError(argVals[i]) {
104 return argVals[i]
105 }
106 unk, _ = types.MaybeMergeUnknowns(argVals[i], unk)
107 }
108 if unk != nil {
109 if costs := frame.CostTracker(); costs != nil {
110 costs.EvalVarArgs(frame, fn.id, fn, argVals, unk)
111 }
112 return unk
113 }
114 result := frame.ComputeResult(fn.ID(), fn.Function(), fn.OverloadID(), fn.impl, argVals)
115 val := types.LabelErrNode(fn.id, result)
116 if costs := frame.CostTracker(); costs != nil {
117 costs.EvalVarArgs(frame, fn.id, fn, argVals, val)
118 }
119 return val
120}
121
122// asyncCallStateTracker manages async call states across re-evaluations of a single program.
123type asyncCallStateTracker struct {

Callers 2

Calls 10

IDMethod · 0.95
FunctionMethod · 0.95
OverloadIDMethod · 0.95
IsErrorFunction · 0.92
MaybeMergeUnknownsFunction · 0.92
LabelErrNodeFunction · 0.92
CostTrackerMethod · 0.80
EvalVarArgsMethod · 0.80
ComputeResultMethod · 0.80
ExecMethod · 0.65

Tested by 2