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
3
3
go 1.16
4
4
5
5
require (
6
- github.com/golang-queue/queue v0.0.10
6
+ github.com/golang-queue/queue v0.0.11
7
7
github.com/nsqio/go-nsq v1.0.8
8
8
github.com/stretchr/testify v1.7.0
9
9
)
Original file line number Diff line number Diff line change 1
1
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8 =
2
2
github.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 =
5
5
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4 =
6
6
github.com/golang/snappy v0.0.1 /go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q =
7
7
github.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 {
91
91
}
92
92
}
93
93
94
+ // WithMetric set custom Metric
95
+ func WithMetric (m queue.Metric ) Option {
96
+ return func (w * Worker ) {
97
+ w .metric = m
98
+ }
99
+ }
100
+
94
101
// NewWorker for struc
95
102
func NewWorker (opts ... Option ) * Worker {
96
103
var err error
@@ -104,6 +111,7 @@ func NewWorker(opts ...Option) *Worker {
104
111
runFunc : func (context.Context , queue.QueuedMessage ) error {
105
112
return nil
106
113
},
114
+ metric : queue .NewMetric (),
107
115
}
108
116
109
117
// Loop through each option
You can’t perform that action at this time.
0 commit comments