batch

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package batch contains the batch node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchConfig

type BatchConfig struct {
	// Mode selects grouping: "count" batches every N messages,
	// "interval" batches everything arriving within a time window,
	// "concat" concatenates a parts sequence into one message
	Mode string `json:"mode"`
	// Count is the batch size for "count" mode
	Count int `json:"count"`
	// Overlap keeps the last N messages of a batch for the next batch
	// ("count" mode)
	Overlap int `json:"overlap"`
	// Interval is the window length in seconds for "interval" mode
	Interval float64 `json:"interval"`
	// HonourParts keeps separate buffers per parts.id in count mode
	HonourParts bool `json:"honourParts"`
}

BatchConfig holds configuration for the batch node — the Node-RED batch equivalent. Groups incoming messages into batches.

type BatchNode

type BatchNode struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

BatchNode groups incoming messages into batches. It drops (returns nil) buffered messages; completed batches go downstream as a single message whose Data is an array of the batched payloads.

func NewBatchNode

func NewBatchNode(node nodestore.NodeInterface, config *BatchConfig, host nodebase.NodeHost) *BatchNode

NewBatchNode creates a new batch node

func (*BatchNode) Execute

Execute buffers and emits a batch message when a batch completes.

func (*BatchNode) Validate

func (n *BatchNode) Validate() error

Validate rejects unsupported modes at deploy time

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL