Categorygithub.com/go-zoox/jobqueue
modulepackage
1.0.1
Repository: https://github.com/go-zoox/jobqueue.git
Documentation: pkg.go.dev

# README

JobQueue - Powerful unlimited job queue with goroutine pool

PkgGoDev Build Status Go Report Card Coverage Status GitHub issues Release

Installation

To install the package, run:

go get github.com/go-zoox/jobqueue

Getting Started

import (
  "testing"
  "github.com/go-zoox/jobqueue"
)

func main(t *testing.T) {
	q := New(runtime.NumCPU())
	q.Start()
	defer q.Stop()

	for i := 0; i < 10; i++ {
		q.AddJob(&NewJob(func() {
			fmt.Println("Process Job")
		}))
	}
}

Inspired by

  • dirkaholic/kyoo - Unlimited job queue for go, using a pool of concurrent workers processing the job queue entries

Related

License

GoZoox is released under the MIT License.

# Functions

New creates a new job queue.
NewJob creates a new job.
NewWorker creates a new worker.

# Constants

JobStatusDone means the job has been processed.
JobStatusFailed means the job has failed to be processed.
JobStatusPending means the job is waiting to be processed.
JobStatusRunning means the job is being processed.

# Variables

Version is the current version of the package.

# Structs

JobQueue is a queue for jobs.
Worker is a worker for job processing.

# Interfaces

Job interface for job processing.