• Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Pure Go embedded persistent job queue backed by BadgerDB

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

  • Pure Go library, no cgo
  • Simple, embedded, persistent job queue
  • Provides in-process job processing to any Go app
  • The jobs/status changes are persisted to disk after each operation and pending jobs can continue processing after an app restart or a crash
  • Allows multiple "processors", each processor/worker processes one job at a time then is assigned a new job, etc
  • The storage engine used is BadgerDB

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:

  • Restart interrupted jobs after app restart/crashes
  • Sweep completed jobs from the "complete" queue
  • Failed Jobs retry options
  • Allow batch enqueuing
  • Add support for Go contexts
  • Test in real conditions under high load
  • Expose Prometheus Metrics in an Http handler
  • Optimize performance / Locking

Contributing

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

More Repositories

1

stone-dapp

Carve your texts in stone on the Ethereum Blockchain
JavaScript
69
star
2

go-consul-distributed-loggers

Simple Go + Consul Distributed System
Go
55
star
3

paperlb

A kubernetes network load balancer implementation
Go
47
star
4

inhooks

Incoming Webhooks Gateway built with Go. Uses Redis for storage/queueing.
Go
45
star
5

async-microservices-demo

Asynchronous Microservices with RabbitMQ andΒ Node Demo
JavaScript
37
star
6

serverless-lambda-sns-example

Serverless Lambda PubSub via SNS Example
JavaScript
36
star
7

k8s-hello-mutating-webhook

A Kubernetes Mutating Admission Webhook example, using Go.
Go
31
star
8

gcf-go-image-resizer

Go Image Resizer Cloud Function
Go
24
star
9

serverless-testing-examples

Serverless Testing Examples
JavaScript
23
star
10

sidekiq-client-cli

Command line client for Sidekiq
Ruby
18
star
11

gcp-api-gateway-demo

GCP API Gateway Demo with Terraform / Go / Cloud Run
Go
15
star
12

quorum-secret-ballot

Secret ballot voting Smart Contract with Quorum
Shell
15
star
13

river-x

Decentralised ERC20 Tokens Exchange
JavaScript
13
star
14

autobucket-operator

Cloud Storage Kubernetes Operator with Go and Operator SDK
Go
12
star
15

sails-hook-mongo-auto-index

JavaScript
10
star
16

nginx-lb-updater

NGINX Load Balancer Updater API
Go
5
star
17

my-btc-predictions

MEAN Stack Single Page Application / Bitcoin Price Forecasts
JavaScript
4
star
18

bucket-text-api

Simple REST API (built with Go) to write text files to Cloud Buckets.
Go
3
star
19

goblero-demo

Demo repo for Goblero Job Queue
Go
3
star
20

freelance-dashboard

Ruby
3
star
21

kubexcloud

Minimalist self service cloud platform built on top of Kubernetes. Built with Go.
Go
3
star
22

meetadev

Meet A Dev - Tinder for Freelance Developers/Client Matching
JavaScript
2
star
23

statefarm-drivers-kaggle

Experimenting with deep learning on statefarm drivers kaggle dataset
Python
2
star
24

howzsurf

A Meteor app allowing using users to track surf conditions at their favorite spots
JavaScript
2
star
25

meetadev-mobile

Meet A Dev Mobile App(Ionic)
CSS
2
star
26

ChatLoop

Rails 4 / Backbone.js Chat App
Ruby
2
star
27

go-generics-insertion-sort

Go Generics Insertion Sort Demo
Go
1
star
28

test-repo

1
star
29

k8s-pod-info-api

API that returns info about the Kubernetes Pod where it's running
Go
1
star
30

ImageOnBlockchain

JavaScript
1
star
31

pingana

rust ping/healthcheck tool
Rust
1
star
32

mnist-basic-example

basic handwritten digits recognition
Python
1
star
33

volusnap

VoluSnap - Cloud Volume auto-snapshot Go Server
Go
1
star
34

bugsnagext

bugsnag-go library extension to add goroutines stacktraces to an error event
Go
1
star
35

protohackers

my solutions for the protohackers challenge
Go
1
star
36

superwish

Wishlist web app (React + Redux)
JavaScript
1
star
37

rpm-voting-token

Ethereum Smart Contract Voting Token
JavaScript
1
star
38

asl-token

ASL Token & Token Sale Contracts
JavaScript
1
star
39

serverless-dynamodb-redis-example

Serverless DynamoDB Redis Example
JavaScript
1
star
40

ng-reviews

Angular.js/Rails Customer Reviews App
JavaScript
1
star
41

belkirk-jekyll-demo

HTML
1
star