destination

package
v0.0.0-...-1d9596f Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchQueue

type BatchQueue struct {
	// contains filtered or unexported fields
}

BatchQueue collects events and send them in batches.

func NewBatchQueue

func NewBatchQueue(target eventkit.Destination, queueSize int, batchSize int, flushInterval time.Duration) *BatchQueue

NewBatchQueue creates a new batchQueue. It sends out the received events in batch. Either after the flushInterval is expired or when there are more than batchSize element in the queue.

func (*BatchQueue) Run

func (c *BatchQueue) Run(ctx context.Context)

Run implements Destination.

func (*BatchQueue) Submit

func (c *BatchQueue) Submit(events ...*eventkit.Event)

Submit implements Destination.

type Parallel

type Parallel struct {
	// contains filtered or unexported fields
}

Parallel sends messages parallel from multiple goroutines.

func NewParallel

func NewParallel(target func() (eventkit.Destination, error), workers int) *Parallel

NewParallel creates a destination. It requires a way to create the worker destinations and the number of goroutines.

func (*Parallel) Run

func (p *Parallel) Run(ctx context.Context)

Run implements eventkit.Destination.

func (*Parallel) Submit

func (p *Parallel) Submit(events ...*eventkit.Event)

Submit implements eventkit.Destination.

Jump to

Keyboard shortcuts

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