Rename Background to Server

This commit is contained in:
Ken Hibino
2020-04-12 08:16:42 -07:00
parent 022dc29701
commit f9842ba914
5 changed files with 65 additions and 65 deletions

View File

@@ -24,7 +24,7 @@ func BenchmarkEndToEndSimple(b *testing.B) {
DB: redisDB,
}
client := NewClient(redis)
bg := NewBackground(redis, &Config{
srv := NewServer(redis, Config{
Concurrency: 10,
RetryDelayFunc: func(n int, err error, t *Task) time.Duration {
return time.Second
@@ -46,11 +46,11 @@ func BenchmarkEndToEndSimple(b *testing.B) {
}
b.StartTimer() // end setup
bg.start(HandlerFunc(handler))
srv.start(HandlerFunc(handler))
wg.Wait()
b.StopTimer() // begin teardown
bg.stop()
srv.stop()
b.StartTimer() // end teardown
}
}
@@ -67,7 +67,7 @@ func BenchmarkEndToEnd(b *testing.B) {
DB: redisDB,
}
client := NewClient(redis)
bg := NewBackground(redis, &Config{
srv := NewServer(redis, Config{
Concurrency: 10,
RetryDelayFunc: func(n int, err error, t *Task) time.Duration {
return time.Second
@@ -99,11 +99,11 @@ func BenchmarkEndToEnd(b *testing.B) {
}
b.StartTimer() // end setup
bg.start(HandlerFunc(handler))
srv.start(HandlerFunc(handler))
wg.Wait()
b.StopTimer() // begin teardown
bg.stop()
srv.stop()
b.StartTimer() // end teardown
}
}
@@ -124,7 +124,7 @@ func BenchmarkEndToEndMultipleQueues(b *testing.B) {
DB: redisDB,
}
client := NewClient(redis)
bg := NewBackground(redis, &Config{
srv := NewServer(redis, Config{
Concurrency: 10,
Queues: map[string]int{
"high": 6,
@@ -160,11 +160,11 @@ func BenchmarkEndToEndMultipleQueues(b *testing.B) {
}
b.StartTimer() // end setup
bg.start(HandlerFunc(handler))
srv.start(HandlerFunc(handler))
wg.Wait()
b.StopTimer() // begin teardown
bg.stop()
srv.stop()
b.StartTimer() // end teardown
}
}