Skip to content

Commit 6e2c98e

Browse files
committed
chore(example): update NATS exmaple
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 61d8f55 commit 6e2c98e

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

_example/nats/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module example
22

33
go 1.16
44

5-
require github.com/appleboy/queue v0.0.4-0.20210726090849-82cf3ebeafc5
5+
require github.com/appleboy/queue v0.0.4-0.20210730034730-99a80f7c71f6

_example/nats/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
github.com/appleboy/queue v0.0.4-0.20210726090849-82cf3ebeafc5 h1:UE6zMJQObLz/E/RcV3EMEXnU2wmeftvf9kNHozS5300=
22
github.com/appleboy/queue v0.0.4-0.20210726090849-82cf3ebeafc5/go.mod h1:cEQW2y7dduAUqUGnGJEK9oM5bZLlc0+3HI9bTUL0+Ek=
3+
github.com/appleboy/queue v0.0.4-0.20210730034730-99a80f7c71f6 h1:IKX9oSPYXWXIvJ3aDqEM458S5gRsFUs9zzFND645te0=
4+
github.com/appleboy/queue v0.0.4-0.20210730034730-99a80f7c71f6/go.mod h1:cEQW2y7dduAUqUGnGJEK9oM5bZLlc0+3HI9bTUL0+Ek=
35
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
46
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
57
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=

_example/nats/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"context"
45
"encoding/json"
56
"fmt"
67
"log"
@@ -31,7 +32,7 @@ func main() {
3132
nats.WithAddr("127.0.0.1:4222"),
3233
nats.WithSubj("example"),
3334
nats.WithQueue("foobar"),
34-
nats.WithRunFunc(func(m queue.QueuedMessage, _ <-chan struct{}) error {
35+
nats.WithRunFunc(func(ctx context.Context, m queue.QueuedMessage) error {
3536
v, ok := m.(*job)
3637
if !ok {
3738
if err := json.Unmarshal(m.Bytes(), &v); err != nil {

0 commit comments

Comments
 (0)