Skip to content

Commit 3525a28

Browse files
committed
chore(example): update nsq exmaple
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 99a80f7 commit 3525a28

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

_example/nsq/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/nsq/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ github.com/appleboy/queue v0.0.4-0.20210726005953-79774a856a1e h1:+Mj8GY3F5J6rJC
66
github.com/appleboy/queue v0.0.4-0.20210726005953-79774a856a1e/go.mod h1:6Mn0z4hURZW/26huvRXG0SJ4o7pBdo6hOryRiegy/4Q=
77
github.com/appleboy/queue v0.0.4-0.20210726090849-82cf3ebeafc5 h1:UE6zMJQObLz/E/RcV3EMEXnU2wmeftvf9kNHozS5300=
88
github.com/appleboy/queue v0.0.4-0.20210726090849-82cf3ebeafc5/go.mod h1:cEQW2y7dduAUqUGnGJEK9oM5bZLlc0+3HI9bTUL0+Ek=
9+
github.com/appleboy/queue v0.0.4-0.20210730034730-99a80f7c71f6 h1:IKX9oSPYXWXIvJ3aDqEM458S5gRsFUs9zzFND645te0=
10+
github.com/appleboy/queue v0.0.4-0.20210730034730-99a80f7c71f6/go.mod h1:cEQW2y7dduAUqUGnGJEK9oM5bZLlc0+3HI9bTUL0+Ek=
911
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
1012
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1113
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=

_example/nsq/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"
@@ -33,7 +34,7 @@ func main() {
3334
nsq.WithChannel("foobar"),
3435
// concurrent job number
3536
nsq.WithMaxInFlight(10),
36-
nsq.WithRunFunc(func(m queue.QueuedMessage, _ <-chan struct{}) error {
37+
nsq.WithRunFunc(func(ctx context.Context, m queue.QueuedMessage) error {
3738
v, ok := m.(*job)
3839
if !ok {
3940
if err := json.Unmarshal(m.Bytes(), &v); err != nil {

0 commit comments

Comments
 (0)