Home

Awesome

Goblero

Pure Go, Simple, Embedded, Persistent Job Queue, backed by BadgerDB

Build Status Coverage Status goreportcard codebeat badge Documentation

DO NOT USE IN PRODUCTION This library is still in Alpha / Work In Progress

About Goblero

Intro article: Introducing Goblero: a Go Embedded Job Queue

P.S: Why is the library named Goblero ? Go for the Go programming language obviously, and Badger in french is "Blaireau", but blero is easier to pronounce :)

Usage

The full API is documented on godoc.org. There is also a demo repo goblero-demo

Get package

go get -u github.com/didil/goblero/pkg/blero

API

// Create a new Blero backend
bl := blero.New("db/")

// Start Blero
bl.Start()

// defer Stopping Blero
defer bl.Stop()

// register a processor
bl.RegisterProcessorFunc(func(j *blero.Job) error {
  // Do some processing, access job name with j.Name, job data with j.Data
})

// enqueue a job
bl.EnqueueJob("MyJob", []byte("My Job Data"))

Benchmarks

# Core i5 laptop / 8GB Ram / SSD 
make bench
BenchmarkEnqueue/EnqueueJob-4          50000            159942 ns/op (~ 6250 ops/s)
BenchmarkEnqueue/dequeueJob-4           5000           2767260 ns/op (~  361 ops/s)

Todo:

Contributing

All contributions (PR, feedback, bug reports, ideas, etc.) are welcome !