File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module github.com/golang-queue/nsq
33go 1.16
44
55require (
6- github.com/golang-queue/queue v0.0.10
6+ github.com/golang-queue/queue v0.0.11
77 github.com/nsqio/go-nsq v1.0.8
88 github.com/stretchr/testify v1.7.0
99)
Original file line number Diff line number Diff line change 11github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8 =
22github.com/davecgh/go-spew v1.1.0 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
3- github.com/golang-queue/queue v0.0.10 h1:cGqMgHMf2eamwdd3hmOzGcSQogGu9tMhhVYPQMrMC1g =
4- github.com/golang-queue/queue v0.0.10 /go.mod h1:ku8iyjYffqYY6Duts+xl+QYfN3/KDK4MEvXMZUkHyio =
3+ github.com/golang-queue/queue v0.0.11 h1:qaE7rOYUh+11NcO6U9zZ7NazglIwEp0j7Dn0sSoavcI =
4+ github.com/golang-queue/queue v0.0.11 /go.mod h1:ku8iyjYffqYY6Duts+xl+QYfN3/KDK4MEvXMZUkHyio =
55github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4 =
66github.com/golang/snappy v0.0.1 /go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q =
77github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI =
Original file line number Diff line number Diff line change @@ -91,6 +91,13 @@ func WithLogger(l queue.Logger) Option {
9191 }
9292}
9393
94+ // WithMetric set custom Metric
95+ func WithMetric (m queue.Metric ) Option {
96+ return func (w * Worker ) {
97+ w .metric = m
98+ }
99+ }
100+
94101// NewWorker for struc
95102func NewWorker (opts ... Option ) * Worker {
96103 var err error
@@ -104,6 +111,7 @@ func NewWorker(opts ...Option) *Worker {
104111 runFunc : func (context.Context , queue.QueuedMessage ) error {
105112 return nil
106113 },
114+ metric : queue .NewMetric (),
107115 }
108116
109117 // Loop through each option
You can’t perform that action at this time.
0 commit comments