Skip to content

Commit ab65c53

Browse files
committed
docs: update example
1 parent dc443d8 commit ab65c53

File tree

6 files changed

+249
-373
lines changed

6 files changed

+249
-373
lines changed

_example/producer-consumer/consumer/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ func main() {
3434
w := redisdb.NewWorker(
3535
redisdb.WithAddr("127.0.0.1:6379"),
3636
redisdb.WithChannel("foobar"),
37-
redisdb.WithRunFunc(func(ctx context.Context, m core.QueuedMessage) error {
37+
redisdb.WithRunFunc(func(ctx context.Context, m core.TaskMessage) error {
3838
var v *job
39-
if err := json.Unmarshal(m.Bytes(), &v); err != nil {
39+
if err := json.Unmarshal(m.Payload(), &v); err != nil {
4040
return err
4141
}
4242
rets <- v.Message

_example/producer-consumer/go.mod

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
module example
22

3-
go 1.16
3+
go 1.22
44

55
require (
66
github.com/appleboy/graceful v0.0.4
7-
github.com/golang-queue/queue v0.1.4-0.20221210024521-cb8720b0c721
7+
github.com/golang-queue/queue v0.3.0
88
github.com/golang-queue/redisdb v0.0.4
99
)
1010

11+
require (
12+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
13+
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
14+
github.com/jpillora/backoff v1.0.0 // indirect
15+
github.com/redis/go-redis/v9 v9.7.0 // indirect
16+
github.com/yassinebenaid/godump v0.11.1 // indirect
17+
)
18+
1119
replace github.com/golang-queue/redisdb => ../../

0 commit comments

Comments
 (0)