Change internal constructor signatures.

Created "params" type to avoid positional arguments.
Personally it feels more explicit and reads better.
This commit is contained in:
Ken Hibino
2020-05-17 12:33:55 -07:00
parent 4e3e053989
commit 4492ed9255
11 changed files with 112 additions and 36 deletions

View File

@@ -64,7 +64,7 @@ type processor struct {
type retryDelayFunc func(n int, err error, task *Task) time.Duration
type newProcessorParams struct {
type processorParams struct {
logger *log.Logger
broker base.Broker
ss *base.ServerState
@@ -76,7 +76,7 @@ type newProcessorParams struct {
}
// newProcessor constructs a new processor.
func newProcessor(params newProcessorParams) *processor {
func newProcessor(params processorParams) *processor {
info := params.ss.GetInfo()
qcfg := normalizeQueueCfg(info.Queues)
orderedQueues := []string(nil)