Documentation
¶
Index ¶
Constants ¶
View Source
const ( KiB int64 = 1024 MiB = 1024 * KiB GiB = 1024 * MiB )
Variables ¶
View Source
var ( ErrStopped = errors.New("tempo: dispatcher stopped") ErrShuttingDown = errors.New("tempo: dispatcher shutting down") ErrQueueFull = errors.New("tempo: dispatcher queue full") ErrNilConfig = errors.New("tempo: nil config") ErrBadInterval = errors.New("tempo: interval must be greater than zero") ErrBadMaxBatchBytes = errors.New("tempo: max batch bytes must not be negative") ErrBadMaxBuffered = errors.New("tempo: max buffered bytes must be greater than zero") ErrPayloadTooLarge = errors.New("tempo: payload exceeds configured buffered byte limit") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Interval time.Duration
MaxBatchBytes int64 // optional
MaxBufferedBytes int64
}
Config configures interval-based flushing and byte-oriented queue limits.
type Dispatcher ¶
type Dispatcher struct {
Q chan []byte
Batch chan [][]byte
Interval time.Duration
MaxBatchBytes int64
MaxBufferedBytes int64
// contains filtered or unexported fields
}
Dispatcher coordinates dispatching of queued payloads by time interval or, when configured, when the preferred batch byte target is met.
func NewDispatcher ¶
func NewDispatcher(c *Config) (*Dispatcher, error)
NewDispatcher returns an initialized instance of Dispatcher.
func (*Dispatcher) Batches ¶
func (d *Dispatcher) Batches() <-chan [][]byte
Batches exposes the batch output stream as a read-only channel.
func (*Dispatcher) Enqueue ¶
func (d *Dispatcher) Enqueue(v []byte) error
Enqueue submits a payload while the dispatcher is running.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
basic-3s-interval
command
|
|
|
basic-producer-consumer
command
|
|
|
cmd/tempo-tune
command
|
|
Click to show internal directories.
Click to hide internal directories.
