Skip to content

Commit dc99021

Browse files
committed
rename
1 parent b99b8ce commit dc99021

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

internal/internal_worker_base.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ type (
142142
logger *zap.Logger
143143
metricsScope tally.Scope
144144

145-
concurrency *worker.Concurrency
145+
concurrency *worker.ConcurrencyLimit
146146
pollerAutoScaler *pollerAutoScaler
147147
taskQueueCh chan interface{}
148148
sessionTokenBucket *sessionTokenBucket
@@ -168,7 +168,7 @@ func createPollRetryPolicy() backoff.RetryPolicy {
168168
func newBaseWorker(options baseWorkerOptions, logger *zap.Logger, metricsScope tally.Scope, sessionTokenBucket *sessionTokenBucket) *baseWorker {
169169
ctx, cancel := context.WithCancel(context.Background())
170170

171-
concurrency := &worker.Concurrency{
171+
concurrency := &worker.ConcurrencyLimit{
172172
PollerPermit: worker.NewPermit(options.pollerCount),
173173
TaskPermit: worker.NewPermit(options.maxConcurrentTask),
174174
}
@@ -190,7 +190,7 @@ func newBaseWorker(options baseWorkerOptions, logger *zap.Logger, metricsScope t
190190
retrier: backoff.NewConcurrentRetrier(pollOperationRetryPolicy),
191191
logger: logger.With(zapcore.Field{Key: tagWorkerType, Type: zapcore.StringType, String: options.workerType}),
192192
metricsScope: tagScope(metricsScope, tagWorkerType, options.workerType),
193-
concurrency: concurrency,
193+
concurrency: concurrency,
194194
pollerAutoScaler: pollerAS,
195195
taskQueueCh: make(chan interface{}), // no buffer, so poller only able to poll new task after previous is dispatched.
196196
limiterContext: ctx,

internal/worker/concurrency.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ import (
3030

3131
var _ Permit = (*permit)(nil)
3232

33-
// Concurrency contains synchronization primitives for dynamically controlling the concurrencies in workers
34-
type Concurrency struct {
33+
// ConcurrencyLimit contains synchronization primitives for dynamically controlling the concurrencies in workers
34+
type ConcurrencyLimit struct {
3535
PollerPermit Permit // controls concurrency of pollers
3636
TaskPermit Permit // controlls concurrency of task processings
3737
}
3838

39-
// Permit is an adaptive
39+
// Permit is an adaptive permit issuer to control concurrency
4040
type Permit interface {
4141
Acquire(context.Context, int) error
4242
AcquireChan(context.Context, *sync.WaitGroup) <-chan struct{}

0 commit comments

Comments
 (0)