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

Method ComputeResult

interpreter/frame.go:240–250  ·  view source on GitHub ↗

ComputeResult tracks and computes the result of the given asynchronous function. The first invocation for a given (node id, args) tuple registers the call state and returns an Unknown which references the call's unique callID. Subsequent invocations return the cached result once the call has comple

(id int64, function, overload string, impl functions.AsyncOp, argVals []ref.Val)

Source from the content-addressed store, hash-verified

238// result once the call has completed. Launching background execution is deferred to post-execution
239// dispatch via DispatchPendingAsyncCalls.
240func (f *ExecutionFrame) ComputeResult(id int64, function, overload string, impl functions.AsyncOp, argVals []ref.Val) ref.Val {
241 if f.ctx == nil || f.ctx.asyncCalls == nil {
242 return types.NewErrWithNodeID(id, "asynchronous function calls require concurrent evaluation and cannot be resolved by a synchronous Eval")
243 }
244 t := f.ctx.asyncCalls
245 acs := t.getOrCreate(id, function, overload, argVals, impl, f.ctx.gate)
246 if res := acs.ResultOrUnknown(); res != nil {
247 return res
248 }
249 return types.NewUnknown(acs.callID, nil)
250}
251
252// DispatchPendingAsyncCalls launches pending asynchronous calls for the specified required call IDs.
253func (f *ExecutionFrame) DispatchPendingAsyncCalls(callIDs []int64) {

Calls 4

NewErrWithNodeIDFunction · 0.92
NewUnknownFunction · 0.92
getOrCreateMethod · 0.80
ResultOrUnknownMethod · 0.80