Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Metrics ¶
type Metrics struct { WallDuration time.Duration ProducerMetrics []*StageMetrics StageMetrics [][]*StageMetrics }
Metrics defines a set of performance metrics collected for an entire pipeline.
type Producer ¶
Producer defines a function building a pipeline producer.
func NewProducer ¶
func NewProducer[T any](fn ProducerFn[T], optFns ...StageOptionFn) Producer[T]
NewProducer defines an initial stage in a pipeline, in which work items of type T are prepared for processing.
func NewRecyclingProducer ¶
func NewRecyclingProducer[T any](fn RecyclingProducerFn[T], optFns ...StageOptionFn) Producer[T]
NewRecyclingProducer defines an initial stage in a pipeline, in which work items of type T are prepared for processing. The provided RecyclingProducerFn should invoke its `get` method to get a previously-allocated work item, only constructing a new work item if `get` returns false.
type ProducerFn ¶
type RecyclingProducerFn ¶
type StageMetrics ¶
type StageMetrics struct { StageName string StageInstance uint WorkDuration, StageDuration time.Duration Items uint }
StageMetrics defines a set of performance metrics collected for a particular pipeline stage.
type StageOptionFn ¶
type StageOptionFn func(so *stageOptions) error
func Concurrency ¶
func Concurrency(concurrency uint) StageOptionFn
Concurrency specifies the desired concurrency of a Stage or Producer. A Stage's concurrency is the number of worker goroutines performing that Stage.
func InputBufferSize ¶
func InputBufferSize(inputBufferSize uint) StageOptionFn
InputBufferSize defines the size of the input buffer of a Stage. For recycling Producers, this defines the size of the input buffer of the recycling mechanism. For non-recyling Producers, this has no effect. Defaults to 1.
func Name ¶
func Name(name string) StageOptionFn
Name specifies the name of a Stage or a Producer, for debugging. If unspecified, the Stage number (0 for the Producer) will be used.