Documentation ¶
Overview ¶
Package policy provides tooling for creating and executing Benthos message batch policies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Batcher ¶
type Batcher struct {
// contains filtered or unexported fields
}
Batcher implements a batching policy by buffering messages until, based on a set of rules, the buffered messages are ready to be sent onwards as a batch.
func (*Batcher) Add ¶
Add a new message part to this batch policy. Returns true if this part triggers the conditions of the policy.
func (*Batcher) CloseAsync ¶
func (p *Batcher) CloseAsync()
CloseAsync shuts down the policy resources.
func (*Batcher) Count ¶
Count returns the number of currently buffered message parts within this policy.
func (*Batcher) Flush ¶
Flush clears all messages stored by this batch policy. Returns nil if the policy is currently empty.
type Config ¶
type Config struct { ByteSize int `json:"byte_size" yaml:"byte_size"` Count int `json:"count" yaml:"count"` Check string `json:"check" yaml:"check"` Period string `json:"period" yaml:"period"` Processors []processor.Config `json:"processors" yaml:"processors"` }
Config contains configuration parameters for a batch policy.
Click to show internal directories.
Click to hide internal directories.