Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBackPressureInit in case initialization fails ErrBackPressureInit = errors.New("backpressure run context failed to initialize") )
Functions ¶
This section is empty.
Types ¶
type Backpressure ¶
type Backpressure interface { // PutMulti handles 0, 1 or more events sent PutMulti(events []interface{}) error }
Backpressure interface (required implementation)
type Option ¶
type Option func(*Options)
Option a single option
func BatchTimeMs ¶
BatchTimeMs how long a wait before sending list of tasks to our worker
func MaxBatchesInQueue ¶
MaxBatchesInQueue - a queue with batches. Defines maximum number of batches help in the batch queue
type Options ¶
type Options struct { BatchTimeMs float64 BatchMaxSize int MaxWorkers int MaxBatchesInQueue int Log mclog.Logger }
Options - settings options insted of defaults
type PressureContext ¶
type PressureContext struct {
// contains filtered or unexported fields
}
PressureContext which combines all the channels
func NewBackpressureContext ¶
func NewBackpressureContext(backpressurePutMulti Backpressure, opts ...Option) (*PressureContext, error)
NewBackpressureContext creates a backpressure run context and kicks off 2 go routinges (consumer and collector)
func (*PressureContext) Add ¶
func (rc *PressureContext) Add(value interface{}) error
Add event to be handled by backpressure mechanism
Click to show internal directories.
Click to hide internal directories.