Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler[Job any] interface { // contains filtered or unexported methods }
Handler processes jobs of the given type.
type Option ¶
type Option func(*config)
Option configures the CachingQueuePoller
func WithConcurrency ¶
func WithConcurrency(concurrency int) Option
WithConcurrency sets the maximum number of concurrent job processing
func WithJobBatchSize ¶
func WithJobBatchSize(size int) Option
WithJobBatchSize sets the maximum number of jobs to process in a batch
type Queue ¶
type Queue[Job any] interface { QueueQueuer[Job] QueueReader[Job] QueueReleaser QueueDeleter }
Queue is an interface for a job queue, combining queuing, reading, releasing, and deleting jobs.
type QueueDeleter ¶
QueueDeleter is an interface for deleting jobs from the queue.
type QueuePoller ¶
type QueuePoller[Job any] struct { // contains filtered or unexported fields }
QueuePoller polls a queue for jobs and processes them using the provided JobHandler.
func NewQueuePoller ¶
func NewQueuePoller[Job any](queue Queue[Job], handler Handler[Job], opts ...Option) (*QueuePoller[Job], error)
NewQueuePoller creates a new QueuePoller instance.
type QueueQueuer ¶
QueueQueuer is an interface for queuing jobs.
type QueueReader ¶
type QueueReader[Job any] interface { Read(ctx context.Context, maxJobs int) ([]WithID[Job], error) }
QueueReader is an interface for reading jobs from the queue.
type QueueReleaser ¶
QueueReleaser is an interface for releasing jobs from the queue.