{"modulePath":"github.com/flant/addon-operator","version":"v1.26.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package queue\n\n## Variables\n\n```go\nvar ErrQueueNotFound = errors.New(\"queue is not found\")\n```\n\n```go\nvar MergeTasks = []sh_task.TaskType{task.ModuleHookRun}\n```\n\n## Types\n\n```go\ntype Callback func(compactedTasks []sh_task.Task, targetTask sh_task.Task)\n```\n\n```go\nfunc CompactionCallback(moduleManager ModuleManager, logger *log.Logger) Callback\n```\n\n```go\ntype ModuleManager interface {\n\tGlobalSynchronizationState() *modules.SynchronizationState\n\tGetModule(moduleName string) *modules.BasicModule\n}\n```\n\n```go\ntype Service struct {\n\tHandle func(ctx context.Context, t sh_task.Task) queue.TaskResult\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewService(ctx context.Context, cfg *ServiceConfig, logger *log.Logger) *Service\n```\n\n```go\nfunc (s *Service) AddLastTaskToMain(t sh_task.Task) error\n```\n\n```go\nfunc (s *Service) AddLastTaskToQueue(queueName string, t sh_task.Task) error\n```\n\n```go\nfunc (s *Service) CombineBindingContextForHook(queueName string, t sh_task.Task, stopCombineFn func(tsk sh_task.Task) bool) *shell_operator.CombineResult\n```\n\n```go\nfunc (s *Service) CreateAndStartQueue(queueName string, callback Callback)\n```\nCreateAndStartQueue creates a named queue with default handler and starts it. It returns false is queue is already created\n\n```go\nfunc (s *Service) DrainNonMainQueue(queueName string)\n```\n\n```go\nfunc (s *Service) GetNumberOfConvergeTasks() int\n```\n\n```go\nfunc (s *Service) GetQueueLength(queueName string) int\n```\n\n```go\nfunc (s *Service) IsQueueExists(queueName string) bool\n```\nIsQueueExists returns true is queue is already created\n\n```go\nfunc (s *Service) MainQueueHasPendingModuleRunTask(moduleName string) bool\n```\nqueueHasPendingModuleRunTask returns true if queue has pending tasks with the type \"ModuleRun\" related to the module \"moduleName\".\n\n```go\nfunc (s *Service) ModuleEnsureCRDsTasksInMainQueueAfterId(afterId string) bool\n```\n\n```go\nfunc (s *Service) RemoveAdjacentConvergeModules(queueName string, afterId string)\n```\nRemoveAdjacentConvergeModules removes ConvergeModules tasks right after the task with the specified ID.\n\n```go\ntype ServiceConfig struct {\n\tEngine *shell_operator.ShellOperator\n\tHandle func(ctx context.Context, t sh_task.Task) queue.TaskResult\n}\n```\n\n","path":"github.com/flant/addon-operator/pkg/task/queue","name":"queue","synopsis":"","isRedistributable":true}
