queue

package
v1.24.10 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrQueueNotFound = errors.New("queue is not found")

Functions

This section is empty.

Types

type Callback added in v1.11.0

type Callback func(compactedTasks []sh_task.Task, targetTask sh_task.Task)

func CompactionCallback added in v1.11.0

func CompactionCallback(moduleManager ModuleManager, logger *log.Logger) Callback

type ModuleManager added in v1.11.0

type ModuleManager interface {
	GlobalSynchronizationState() *modules.SynchronizationState
	GetModule(moduleName string) *modules.BasicModule
}

type Service

type Service struct {
	Handle func(ctx context.Context, t sh_task.Task) queue.TaskResult
	// contains filtered or unexported fields
}

func NewService

func NewService(ctx context.Context, cfg *ServiceConfig, logger *log.Logger) *Service

func (*Service) AddLastTaskToMain

func (s *Service) AddLastTaskToMain(t sh_task.Task) error

func (*Service) AddLastTaskToQueue

func (s *Service) AddLastTaskToQueue(queueName string, t sh_task.Task) error

func (*Service) CombineBindingContextForHook

func (s *Service) CombineBindingContextForHook(queueName string, t sh_task.Task, stopCombineFn func(tsk sh_task.Task) bool) *shell_operator.CombineResult

func (*Service) CreateAndStartQueue

func (s *Service) CreateAndStartQueue(queueName string, callback Callback)

CreateAndStartQueue creates a named queue with default handler and starts it. It returns false is queue is already created

func (*Service) DrainNonMainQueue

func (s *Service) DrainNonMainQueue(queueName string)

func (*Service) GetNumberOfConvergeTasks

func (s *Service) GetNumberOfConvergeTasks() int

func (*Service) GetQueueLength added in v1.10.0

func (s *Service) GetQueueLength(queueName string) int

func (*Service) IsQueueExists

func (s *Service) IsQueueExists(queueName string) bool

IsQueueExists returns true is queue is already created

func (*Service) MainQueueHasPendingModuleRunTask

func (s *Service) MainQueueHasPendingModuleRunTask(moduleName string) bool

queueHasPendingModuleRunTask returns true if queue has pending tasks with the type "ModuleRun" related to the module "moduleName".

func (*Service) ModuleEnsureCRDsTasksInMainQueueAfterId

func (s *Service) ModuleEnsureCRDsTasksInMainQueueAfterId(afterId string) bool

func (*Service) RemoveAdjacentConvergeModules

func (s *Service) RemoveAdjacentConvergeModules(queueName string, afterId string)

RemoveAdjacentConvergeModules removes ConvergeModules tasks right after the task with the specified ID.

type ServiceConfig

type ServiceConfig struct {
	Engine *shell_operator.ShellOperator
	Handle func(ctx context.Context, t sh_task.Task) queue.TaskResult
}

Jump to

Keyboard shortcuts

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