File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ module example
2
2
3
3
go 1.16
4
4
5
- require github.com/appleboy/queue v0.0.4-0.20210726090849-82cf3ebeafc5
5
+ require github.com/appleboy/queue v0.0.4-0.20210730034730-99a80f7c71f6
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ github.com/appleboy/queue v0.0.4-0.20210726005953-79774a856a1e h1:+Mj8GY3F5J6rJC
6
6
github.com/appleboy/queue v0.0.4-0.20210726005953-79774a856a1e /go.mod h1:6Mn0z4hURZW/26huvRXG0SJ4o7pBdo6hOryRiegy/4Q =
7
7
github.com/appleboy/queue v0.0.4-0.20210726090849-82cf3ebeafc5 h1:UE6zMJQObLz/E/RcV3EMEXnU2wmeftvf9kNHozS5300 =
8
8
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 =
9
11
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8 =
10
12
github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
11
13
github.com/golang/protobuf v1.4.0-rc.1 /go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8 =
Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
+ "context"
4
5
"encoding/json"
5
6
"fmt"
6
7
"log"
@@ -33,7 +34,7 @@ func main() {
33
34
nsq .WithChannel ("foobar" ),
34
35
// concurrent job number
35
36
nsq .WithMaxInFlight (10 ),
36
- nsq .WithRunFunc (func (m queue. QueuedMessage , _ <- chan struct {} ) error {
37
+ nsq .WithRunFunc (func (ctx context. Context , m queue. QueuedMessage ) error {
37
38
v , ok := m .(* job )
38
39
if ! ok {
39
40
if err := json .Unmarshal (m .Bytes (), & v ); err != nil {
You can’t perform that action at this time.
0 commit comments