NewExecutionFrame creates a new execution frame from the pool.
(input any)
| 71 | |
| 72 | // NewExecutionFrame creates a new execution frame from the pool. |
| 73 | func NewExecutionFrame(input any) (*ExecutionFrame, error) { |
| 74 | f := frameStack.Get().(*ExecutionFrame) |
| 75 | switch v := input.(type) { |
| 76 | case Activation: |
| 77 | f.Activation = v |
| 78 | case map[string]any: |
| 79 | f.Activation = activationInput.create(v) |
| 80 | default: |
| 81 | return nil, fmt.Errorf("invalid input, wanted Activation or map[string]any, got: (%T)%v", input, input) |
| 82 | } |
| 83 | return f, nil |
| 84 | } |
| 85 | |
| 86 | // SetContext sets the context for the execution frame. |
| 87 | func (f *ExecutionFrame) SetContext(ctx context.Context, interruptCheckFrequency uint) error { |