queue

package
v1.7.10 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2025 License: Apache-2.0 Imports: 11 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 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)

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) 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