File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
require (
6
6
github.com/go-redis/redis/v8 v8.11.3
7
- github.com/golang-queue/queue v0.0.10
7
+ github.com/golang-queue/queue v0.0.11
8
8
github.com/stretchr/testify v1.7.0
9
9
)
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ github.com/go-redis/redis/v8 v8.11.3/go.mod h1:xNJ9xDG09FsIPwh3bWdk+0oDWHbtF9rPN
13
13
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 /go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE =
14
14
github.com/golang-queue/queue v0.0.10 h1:cGqMgHMf2eamwdd3hmOzGcSQogGu9tMhhVYPQMrMC1g =
15
15
github.com/golang-queue/queue v0.0.10 /go.mod h1:ku8iyjYffqYY6Duts+xl+QYfN3/KDK4MEvXMZUkHyio =
16
+ github.com/golang-queue/queue v0.0.11 h1:qaE7rOYUh+11NcO6U9zZ7NazglIwEp0j7Dn0sSoavcI =
17
+ github.com/golang-queue/queue v0.0.11 /go.mod h1:ku8iyjYffqYY6Duts+xl+QYfN3/KDK4MEvXMZUkHyio =
16
18
github.com/golang/protobuf v1.2.0 /go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U =
17
19
github.com/golang/protobuf v1.4.0-rc.1 /go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8 =
18
20
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208 /go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA =
Original file line number Diff line number Diff line change @@ -116,6 +116,13 @@ func WithLogger(l queue.Logger) Option {
116
116
}
117
117
}
118
118
119
+ // WithMetric set custom Metric
120
+ func WithMetric (m queue.Metric ) Option {
121
+ return func (w * Worker ) {
122
+ w .metric = m
123
+ }
124
+ }
125
+
119
126
// NewWorker for struc
120
127
func NewWorker (opts ... Option ) * Worker {
121
128
var err error
@@ -128,6 +135,7 @@ func NewWorker(opts ...Option) *Worker {
128
135
runFunc : func (context.Context , queue.QueuedMessage ) error {
129
136
return nil
130
137
},
138
+ metric : queue .NewMetric (),
131
139
}
132
140
133
141
// Loop through each option
You can’t perform that action at this time.
0 commit comments