https://github.com/grafana/go-rsmq
Go implementation of https://github.com/smrchy/rsmq
https://github.com/grafana/go-rsmq
keep
Last synced: 8 months ago
JSON representation
Go implementation of https://github.com/smrchy/rsmq
- Host: GitHub
- URL: https://github.com/grafana/go-rsmq
- Owner: grafana
- Created: 2020-03-30T20:08:03.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-28T09:52:43.000Z (almost 6 years ago)
- Last Synced: 2025-01-29T11:51:24.745Z (over 1 year ago)
- Topics: keep
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 10
- Watchers: 146
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-rsmq
[](https://godoc.org/github.com/grafana/go-rsmq)
A Go implementation of the Node.js [rsmq](https://github.com/smrchy/rsmq) package.
## Example
```go
// Create a redis client
client := redis.NewClient(&redis.Options{
Addr: "localhost:6379",
})
mq := rsmq.NewRedisSMQ(client, "")
err = mq.CreateQueue("myqueue")
if err != nil {
return err
}
messageID, err := mq.SendMessage("myqueue", "hello")
if err != nil {
return err
}
message, err := mq.ReceiveMessage("myqueue")
if err != nil {
return err
}
if message != nil {
mq.DeleteMessage("myqueue", message.ID)
if err != nil {
return err
}
}
```
## TODO
- Finish tests. The message send side is covered ok, but not the receive side.