configs

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PipelineConfig

type PipelineConfig struct {
	ManualStart           bool
	MaxGoroutinesTotal    int
	MaxGoroutinesPerStage int
	Timeout               time.Duration
	Logger                logging.Logger
	InitStageConfig       *StageConfig
}

PipelineConfig is a struct that contains the configuration for a pipeline.

[PipelineConfig.ManualStart] is a boolean that indicates whether the pipeline should be started manually. If it is passed as true, the pipeline will not start automatically on creation, and it's up to the user to start it by calling the [pipeline.Pipeline.Start] method.

[PipelineConfig.MaxGoroutinesTotal] is an integer that indicates the maximum number of goroutines that can be spawned by the pipeline. If it is passed as 0 or less, then there is no limit. Please, note that the real number of goroutines is always greater than the defined size, as: - there are service goroutines that are not limited by the rate limiter - even if the pipeline rate limiter is full, the program will spawn a new goroutine if there is no workers for the current stage

[PipelineConfig.MaxGoroutinesPerStage] is an integer that indicates the maximum number of goroutines that can be spawned by each stage. If it is passed as 0 or less, then there is no limit. It is possible to change the limit for each stage individually - see [StageConfig.MaxGoroutines].

[PipelineConfig.Timeout] indicates the timeout for the pipeline. If it is passed as 0 or less, then there is no timeout.

[PipelineConfig.Logger] is a logger that will be used by the pipeline. If it is passed as nil, then the logging.NoOpsLogger logger will be used that does nothing.

[PipelineConfig.InitStageConfig] is a config for the init stage. See StageConfig for more details.

type StageConfig

type StageConfig struct {
	MaxGoroutines int
	Timeout       time.Duration
	CustomId      int64
	Logger        logging.Logger
}

StageConfig is a struct that holds the configuration for a stage.

[StageConfig.MaxGoroutines] is the maximum number of goroutines that can be spawned within the stage. If it is passed as 0 or less, then there is no limit. This config option can be used to change the limit for each stage that comes from the [PipelineConfig.MaxGoroutinesPerStage] option (if provided).

[StageConfig.Timeout] is the timeout for the stage. If it is passed as 0 or less, then there is no timeout.

[StageConfig.CustomId] is a custom ID for the stage. If it is passed as 0, then the stage will be assigned an ID automatically. Auto-generated IDs are calculated as follows: 1 + the ID of the previous stage. The initial stage (the one that is created first) has an ID of 1. It is recommended to either rely on the auto-generated IDs or to provide a custom ID for each stage, otherwise the IDs might be messed up due to the (1 + the ID of the previous stage) logic mentioned above.

[StageConfig.Logger] is a logger that will be used by the stage. If it is passed as nil, then the logging.NoOpsLogger logger will be used that does nothing. This config option can be used to change the logger for each stage that comes from the [PipelineConfig.Logger] option (if provided).

Jump to

Keyboard shortcuts

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