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

@@ -65,7 +65,7 @@ func TestProcessorSuccess(t *testing.T) {
return nil
}
ss := base.NewServerState("localhost", 1234, 10, defaultQueueConfig, false)
p := newProcessor(newProcessorParams{
p := newProcessor(processorParams{
logger: testLogger,
broker: rdbClient,
ss: ss,
@@ -170,7 +170,7 @@ func TestProcessorRetry(t *testing.T) {
n++
}
ss := base.NewServerState("localhost", 1234, 10, defaultQueueConfig, false)
p := newProcessor(newProcessorParams{
p := newProcessor(processorParams{
logger: testLogger,
broker: rdbClient,
ss: ss,
@@ -243,7 +243,7 @@ func TestProcessorQueues(t *testing.T) {
for _, tc := range tests {
ss := base.NewServerState("localhost", 1234, 10, tc.queueCfg, false)
p := newProcessor(newProcessorParams{
p := newProcessor(processorParams{
logger: testLogger,
broker: nil,
ss: ss,
@@ -319,7 +319,7 @@ func TestProcessorWithStrictPriority(t *testing.T) {
}
// Note: Set concurrency to 1 to make sure tasks are processed one at a time.
ss := base.NewServerState("localhost", 1234, 1 /* concurrency */, queueCfg, true /*strict*/)
p := newProcessor(newProcessorParams{
p := newProcessor(processorParams{
logger: testLogger,
broker: rdbClient,
ss: ss,