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

Method ComputeResult

interpreter/frame.go:395–405  ·  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

393// result once the call has completed. Launching background execution is deferred to post-execution
394// dispatch via DispatchPendingAsyncCalls.
395func (f *ExecutionFrame) ComputeResult(id int64, function, overload string, impl functions.AsyncOp, argVals []ref.Val) ref.Val {
396 if f.ctx == nil || f.ctx.asyncCalls == nil {
397 return types.NewErrWithNodeID(id, "asynchronous function calls require concurrent evaluation and cannot be resolved by a synchronous Eval")
398 }
399 t := f.ctx.asyncCalls
400 acs := t.getOrCreate(id, function, overload, argVals, impl, f.ctx.gate)
401 if res := acs.ResultOrUnknown(); res != nil {
402 return res
403 }
404 return types.NewUnknown(acs.callID, nil)
405}
406
407// DispatchPendingAsyncCalls launches pending asynchronous calls for the specified required call IDs.
408func (f *ExecutionFrame) DispatchPendingAsyncCalls(callIDs []int64) {

Calls 4

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