BypassAsyncProtection allows for the bypass of hasAsync protection in Eval and ContextEval if present. By default, expressions in an environment with asynchronous functions will reject calls to Eval and ContextEval, requiring ConcurrentEval instead. This option bypasses that check, allowing synchro
()
| 861 | // synchronous evaluation of expressions that do not actually call asynchronous functions (such as |
| 862 | // constant validations). |
| 863 | func BypassAsyncProtection() ProgramOption { |
| 864 | return func(p *prog) (*prog, error) { |
| 865 | p.hasAsync = false |
| 866 | return p, nil |
| 867 | } |
| 868 | } |
| 869 | |
| 870 | // CostEstimatorOptions configure type-check time options for estimating expression cost. |
| 871 | func CostEstimatorOptions(costOpts ...cost.CostOption) EnvOption { |
no outgoing calls