A client of the go-delayqueue for golang project.
- Push message to delayqueue.
- Delete a message from delayqueue.
- Send Ping test message.
- Upate a message in the delayqueue.
import (
delayclient "godelayqueueclient"
)
testHost := "127.0.0.1"
fromNowDelaySeconds := 600
// notify by HTTP
client := delayclient.NewClientWithHostAndPort(testHost, "3450")
resp, err := client.Push(fromNowDelaySeconds,
delayclient.HTTP,
fmt.Sprintf("https://google.com", testHost),
"hello,world")
if err != nil {
t.Log(err)
} else {
t.Log(resp)
t.Log(resp.TaskId)
}
// notify by third queue (such as rabbitmq)
var PubSubQueueName = "pubsub-queue"
resp, err := client.Push(fromNowDelaySeconds, delayclient.SubPub, PubSubQueueName, "hello,world")
if err != nil {
t.Log(err)
} else {
t.Log(resp)
t.Log(resp.TaskId)
}
Anyone is welcome to submit pull requests and suggestions, issues.
See LICENSE