Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobContext ¶
JobContext provides context for a job which is injected into the job Process method.
type JobQueue ¶
type JobQueue[T any] struct { // contains filtered or unexported fields }
func New ¶ added in v0.1.4
func New[T any]( dbPath string, name string, workers int, handler func(JobContext, T) error, opts ...Option[T], ) (*JobQueue[T], error)
New creates a new JobQueue with the specified database, name, and number of worker goroutines. It initializes the job queue, starts the worker goroutines, and returns the JobQueue instance and an error, if any.
type Option ¶
func WithFetchInterval ¶
WithFetchInterval sets the interval at which the job queue fetches jobs from BadgerDB.
func WithInmemDB ¶ added in v0.1.5
WithInmemDB uses an in-memory BadgerDB instead of a persistent one. Useful for testing, but provides no durability guarantees.
func WithJobBufferSize ¶ added in v0.1.3
WithJobBufferSize sets the size of the job channel.
Click to show internal directories.
Click to hide internal directories.