Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultBatchMaxSize = 1000 DefaultMaxRetryCount = 0 DefaultRetryDelay = time.Second DefaultBufferDuration = time.Minute DefaultInactiveTimeout = 5 * time.Second DefaultMaxPendingEntries = 10000 DefaultMaxConcurrentDeliveries = 1 DefaultDeliveryTimeout = 10 * time.Second DefaultShutdownTimeout = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Name string
PluginID string
BatchMaxSize int
MaxRetryCount int
RetryDelay time.Duration
RetryDelaySet bool
BufferDuration time.Duration
InactiveTimeout time.Duration
MaxPendingEntries int
MaxConcurrentDeliveries int
DeliveryTimeout time.Duration
ShutdownTimeout time.Duration
RouteID string
ServerAddr string
}
type ContextDeliveryFunc ¶
type ContextDeliveryFunc func(ctx context.Context, entries []map[string]any, batchMaxSize int) (firstFail int, err error)
ContextDeliveryFunc must stop transport work and return after ctx is done. Sink resources remain owned until the callback has actually returned.
type DeliveryFunc ¶
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func New ¶
func New(config Config, deliver DeliveryFunc) *Processor
func NewWithContext ¶
func NewWithContext(config Config, deliver ContextDeliveryFunc) *Processor
func (*Processor) StopWithCleanup ¶
func (p *Processor) StopWithCleanup(cleanup func())
StopWithCleanup keeps delivery-owned resources alive until every callback has returned. Stop remains bounded; if a callback ignores cancellation, the cleanup runs asynchronously after that callback eventually exits.
Click to show internal directories.
Click to hide internal directories.