--- Batch Node (Processes items individually) --- BatchNode implements BaseNode to process slices of items.
| 341 | |
| 342 | // BatchNode implements BaseNode to process slices of items. |
| 343 | type BatchNode struct { |
| 344 | nodeCore |
| 345 | MaxRetries int |
| 346 | WaitMilliseconds time.Duration |
| 347 | |
| 348 | // User-defined functions |
| 349 | // Prep returns a slice (or error) |
| 350 | PrepFunc func(ctx *PfContext, params map[string]any) ([]any, error) |
| 351 | // ExecItem operates on a single item from the Prep slice |
| 352 | ExecItemFunc func(ctx *PfContext, params map[string]any, item any) (any, error) |
| 353 | // Post receives the original prep slice and the slice of exec results |
| 354 | PostFunc func(ctx *PfContext, params map[string]any, prepResult []any, execResult []any) (string, error) |
| 355 | |
| 356 | // Optional fallback for individual item processing |
| 357 | ExecItemFallbackFunc func(ctx *PfContext, params map[string]any, item any, lastErr error) (any, error) |
| 358 | } |
| 359 | |
| 360 | // NewBatchNode creates a new BatchNode with default settings. |
| 361 | func NewBatchNode() *BatchNode { |
nothing calls this directly
no outgoing calls
no test coverage detected