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

Function awaitEval

cel/program_async_test.go:919–928  ·  view source on GitHub ↗

awaitEval runs ConcurrentEval and returns the result or fails on timeout.

(t *testing.T, prg cel.Program, ctx context.Context, in any)

Source from the content-addressed store, hash-verified

917
918// awaitEval runs ConcurrentEval and returns the result or fails on timeout.
919func awaitEval(t *testing.T, prg cel.Program, ctx context.Context, in any) cel.EvalResult {
920 t.Helper()
921 select {
922 case res := <-prg.ConcurrentEval(ctx, in):
923 return res
924 case <-time.After(5 * time.Second):
925 t.Fatal("ConcurrentEval() timed out")
926 return cel.EvalResult{}
927 }
928}
929
930// mustProgram compiles an expression and constructs a Program, separating EnvOptions and ProgramOptions.
931func mustProgram(t *testing.T, expr string, opts ...any) cel.Program {

Calls 1

ConcurrentEvalMethod · 0.65

Tested by

no test coverage detected