Skip to content

not-empty/taurus-publisher-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Bull publisher

Latest Version PRs Welcome

Go bull publisher is a lib that provides a publisher for bull queues

Installation

go get github.com/kiwfy/golang-bull-publisher

Usage

Below is an example which shows some common use cases for publisher.

package main

import (
	"context"
	"time"

	bullpublisher "github.com/kiwfy/golang-bull-publisher"
	"github.com/redis/go-redis/v9"
)

type testeando struct {
	Name string `json:"name"`
	Data int64  `json:"data"`
}

func main() {
	redis := redis.NewClient(&redis.Options{
		Addr: "localhost:6379",
	})
	context := context.Background()
	publisher := &bullpublisher.Publisher{
		Redis:   redis,
		Context: context,
	}

	publisher.AddJob(
		"teste",
		&testando{
			Name: "levy",
			Data: time.Now().Unix(),
		},
		bullpublisher.Options{
			Attempts:           1,
			Backoff:            0,
			Delay:              0,
			Lifo:               false,
			PreventParsingData: false,
			Priority:           0,
			RemoveOnComplete:   10,
			RemoveOnFail:       1,
			Timeout:            0,
			JobId:              "123t87236482",
			Timestamp:          time.Now().Unix(),
		},
		"process",
	)
}

Kiwfy - Open your code, open your mind!

About

Go bull publisher is a lib that provides a publisher for bull queues

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •