https://github.com/not-empty/taurus-publisher-golang
Go bull publisher is a lib that provides a publisher for bull queues
https://github.com/not-empty/taurus-publisher-golang
Last synced: 6 months ago
JSON representation
Go bull publisher is a lib that provides a publisher for bull queues
- Host: GitHub
- URL: https://github.com/not-empty/taurus-publisher-golang
- Owner: not-empty
- License: mit
- Created: 2023-03-01T19:01:21.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-18T22:16:11.000Z (over 2 years ago)
- Last Synced: 2025-04-12T05:36:55.433Z (about 1 year ago)
- Language: Go
- Homepage:
- Size: 15.6 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Bull publisher
[](https://github.com/kiwfy/golang-bull-publisher/releases)
[](http://makeapullrequest.com)
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.
```go
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!**