Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

go-queue

Fork form github.com/zeromicro/go-queue

dq

High available beanstalkd with auth.

consumer example

consumer:=dq.NewConsumer(dq.DqConf{
Beanstalks: []dq.Beanstalk{
{
Endpoint: "localhost:11300",
Password: "your_password",
Tube: "tube",
},
{
Endpoint: "localhost:11300",
Password: "your_password",
Tube: "tube",
},
},
Redis: redis.RedisConf{
Host: "localhost:6379",
Type: redis.NodeType,
},
})
consumer.Consume(func(body []byte) {
fmt.Println(string(body))
})

producer example

producer:=dq.NewProducer([]dq.Beanstalk{
{
Endpoint: "localhost:11300",
Password: "your_password",
Tube: "tube",
},
{
Endpoint: "localhost:11300",
Password: "your_password",
Tube: "tube",
},
})
fori:=1000; i<1005; i++ {
_, err:=producer.Delay([]byte(strconv.Itoa(i)), time.Second*5)
iferr!=nil {
fmt.Println(err)
}
}

About

Fork form github.com/zeromicro/go-queue

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages