Versions in this module Expand all Collapse all v0 v0.3.0 Feb 27, 2025 Changes in this version + var ErrMaxCapacity = errors.New("golang-queue: maximum size limit reached") + var ErrMissingWorker = errors.New("missing worker module") + var ErrNoTaskInQueue = errors.New("golang-queue: no task in queue") + var ErrQueueHasBeenClosed = errors.New("golang-queue: queue has been closed") + var ErrQueueShutdown = errors.New("queue has been closed and released") + type Logger interface + Error func(args ...interface{}) + Errorf func(format string, args ...interface{}) + Fatal func(args ...interface{}) + Fatalf func(format string, args ...interface{}) + Info func(args ...interface{}) + Infof func(format string, args ...interface{}) + func NewEmptyLogger() Logger + func NewLogger() Logger + type Metric interface + BusyWorkers func() int64 + CompletedTasks func() uint64 + DecBusyWorker func() + FailureTasks func() uint64 + IncBusyWorker func() + IncFailureTask func() + IncSubmittedTask func() + IncSuccessTask func() + SubmittedTasks func() uint64 + SuccessTasks func() uint64 + func NewMetric() Metric + type Option interface + func WithAfterFn(afterFn func()) Option + func WithFn(fn func(context.Context, core.TaskMessage) error) Option + func WithLogger(l Logger) Option + func WithMetric(m Metric) Option + func WithQueueSize(num int) Option + func WithWorker(w core.Worker) Option + func WithWorkerCount(num int64) Option + type OptionFunc func(*Options) + type Options struct + func NewOptions(opts ...Option) *Options + type Queue struct + func NewPool(size int64, opts ...Option) *Queue + func NewQueue(opts ...Option) (*Queue, error) + func (q *Queue) BusyWorkers() int64 + func (q *Queue) CompletedTasks() uint64 + func (q *Queue) FailureTasks() uint64 + func (q *Queue) Queue(message core.QueuedMessage, opts ...job.AllowOption) error + func (q *Queue) QueueTask(task job.TaskFunc, opts ...job.AllowOption) error + func (q *Queue) Release() + func (q *Queue) Shutdown() + func (q *Queue) Start() + func (q *Queue) SubmittedTasks() uint64 + func (q *Queue) SuccessTasks() uint64 + func (q *Queue) UpdateWorkerCount(num int64) + func (q *Queue) Wait() + type Ring struct + func NewRing(opts ...Option) *Ring + func (s *Ring) Queue(task core.TaskMessage) error + func (s *Ring) Request() (core.TaskMessage, error) + func (s *Ring) Run(ctx context.Context, task core.TaskMessage) error + func (s *Ring) Shutdown() error