queue

package
v1.17.11 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

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