Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
Type string
Payload interface{}
}
Job represents a unit of work to be processed by a worker.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler handles periodic scheduling of jobs.
func NewScheduler ¶
func NewScheduler(wp *WorkerPool) *Scheduler
NewScheduler initializes a new Scheduler.
type WorkerPool ¶
type WorkerPool struct {
JobQueue chan Job
NumWorkers int
// contains filtered or unexported fields
}
WorkerPool manages a pool of workers to process jobs.
func NewWorkerPool ¶
func NewWorkerPool(db *db.Database, numWorkers int) *WorkerPool
NewWorkerPool initializes a new WorkerPool.
func (*WorkerPool) Start ¶
func (wp *WorkerPool) Start()
Start initializes the worker pool and starts processing jobs.
Click to show internal directories.
Click to hide internal directories.