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 1
1
github.com/appleboy/queue v0.0.4-0.20210726090849-82cf3ebeafc5 h1:UE6zMJQObLz/E/RcV3EMEXnU2wmeftvf9kNHozS5300 =
2
2
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 =
3
5
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8 =
4
6
github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
5
7
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"
@@ -31,7 +32,7 @@ func main() {
31
32
nats .WithAddr ("127.0.0.1:4222" ),
32
33
nats .WithSubj ("example" ),
33
34
nats .WithQueue ("foobar" ),
34
- nats .WithRunFunc (func (m queue. QueuedMessage , _ <- chan struct {} ) error {
35
+ nats .WithRunFunc (func (ctx context. Context , m queue. QueuedMessage ) error {
35
36
v , ok := m .(* job )
36
37
if ! ok {
37
38
if err := json .Unmarshal (m .Bytes (), & v ); err != nil {
You can’t perform that action at this time.
0 commit comments