Versions in this module Expand all Collapse all v0 v0.19.4 May 24, 2023 Changes in this version + var ErrAlreadyInQueue = util.NewAlreadyExistErrorf("already in queue") + type BaseConfig struct + ConnStr string + DataFullDir string + Length int + ManagedName string + QueueFullName string + SetFullName string + type HandlerFuncT func(...T) (unhandled []T) + type ManagedWorkerPoolQueue interface + FlushWithContext func(ctx context.Context, timeout time.Duration) error + GetItemTypeName func() string + GetName func() string + GetQueueItemNumber func() int + GetType func() string + GetWorkerActiveNumber func() int + GetWorkerMaxNumber func() int + GetWorkerNumber func() int + RemoveAllItems func(ctx context.Context) error + SetWorkerMaxNumber func(num int) + type Manager struct + Queues map[int64]ManagedWorkerPoolQueue + func GetManager() *Manager + func (m *Manager) AddManagedQueue(managed ManagedWorkerPoolQueue) + func (m *Manager) FlushAll(ctx context.Context, timeout time.Duration) error + func (m *Manager) GetManagedQueue(qid int64) ManagedWorkerPoolQueue + func (m *Manager) ManagedQueues() map[int64]ManagedWorkerPoolQueue + type WorkerPoolQueue struct + func CreateSimpleQueue(name string, handler HandlerFuncT[T]) *WorkerPoolQueue[T] + func CreateUniqueQueue(name string, handler HandlerFuncT[T]) *WorkerPoolQueue[T] + func NewWorkerPoolQueueBySetting(name string, queueSetting setting.QueueSettings, handler HandlerFuncT[T], ...) (*WorkerPoolQueue[T], error) + func (q *WorkerPoolQueue[T]) FlushWithContext(ctx context.Context, timeout time.Duration) (err error) + func (q *WorkerPoolQueue[T]) GetItemTypeName() string + func (q *WorkerPoolQueue[T]) GetName() string + func (q *WorkerPoolQueue[T]) GetQueueItemNumber() int + func (q *WorkerPoolQueue[T]) GetType() string + func (q *WorkerPoolQueue[T]) GetWorkerActiveNumber() int + func (q *WorkerPoolQueue[T]) GetWorkerMaxNumber() int + func (q *WorkerPoolQueue[T]) GetWorkerNumber() int + func (q *WorkerPoolQueue[T]) Has(data T) (bool, error) + func (q *WorkerPoolQueue[T]) Push(data T) error + func (q *WorkerPoolQueue[T]) RemoveAllItems(ctx context.Context) error + func (q *WorkerPoolQueue[T]) Run(atShutdown, atTerminate func(func())) + func (q *WorkerPoolQueue[T]) SetWorkerMaxNumber(num int) + func (q *WorkerPoolQueue[T]) ShutdownWait(timeout time.Duration)