diff --git a/client/pool.go b/client/pool.go index 23efb74..08933bf 100644 --- a/client/pool.go +++ b/client/pool.go @@ -60,10 +60,11 @@ type Pool struct { } // Return a new pool. -func NewPool() (pool *Pool) { +func NewPool(selectionFn SelectionHandler, errorFn ErrorHandler) (pool *Pool) { return &Pool{ clients: make(map[string]*poolClient, poolSize), - SelectionHandler: SelectWithRate, + SelectionHandler: selectionFn, + ErrorHandler: errorFn, } } diff --git a/client/pool_test.go b/client/pool_test.go index 5324db9..bb85aa8 100644 --- a/client/pool_test.go +++ b/client/pool_test.go @@ -5,7 +5,7 @@ import ( ) var ( - pool = NewPool() + pool = NewPool(selectWithRate, func(error) {}) ) func TestPoolAdd(t *testing.T) {