|
|
@ -26,16 +26,19 @@ func TestChannelQueue(t *testing.T) {
|
|
|
|
queue, err := NewChannelQueue(handle,
|
|
|
|
queue, err := NewChannelQueue(handle,
|
|
|
|
ChannelQueueConfiguration{
|
|
|
|
ChannelQueueConfiguration{
|
|
|
|
WorkerPoolConfiguration: WorkerPoolConfiguration{
|
|
|
|
WorkerPoolConfiguration: WorkerPoolConfiguration{
|
|
|
|
QueueLength: 20,
|
|
|
|
QueueLength: 0,
|
|
|
|
MaxWorkers: 10,
|
|
|
|
MaxWorkers: 10,
|
|
|
|
BlockTimeout: 1 * time.Second,
|
|
|
|
BlockTimeout: 1 * time.Second,
|
|
|
|
BoostTimeout: 5 * time.Minute,
|
|
|
|
BoostTimeout: 5 * time.Minute,
|
|
|
|
BoostWorkers: 5,
|
|
|
|
BoostWorkers: 5,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Workers: 1,
|
|
|
|
Workers: 0,
|
|
|
|
|
|
|
|
Name: "TestChannelQueue",
|
|
|
|
}, &testData{})
|
|
|
|
}, &testData{})
|
|
|
|
assert.NoError(t, err)
|
|
|
|
assert.NoError(t, err)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert.Equal(t, queue.(*ChannelQueue).WorkerPool.boostWorkers, 5)
|
|
|
|
|
|
|
|
|
|
|
|
go queue.Run(nilFn, nilFn)
|
|
|
|
go queue.Run(nilFn, nilFn)
|
|
|
|
|
|
|
|
|
|
|
|
test1 := testData{"A", 1}
|
|
|
|
test1 := testData{"A", 1}
|
|
|
|