2
0

NewPool takes Config

This allows for backwards compatible additions. No features are planned
but this would make it easier if they are added.
This commit is contained in:
Jack Christensen
2022-09-03 11:45:07 -05:00
parent f63192c063
commit b1aadee38e
3 changed files with 105 additions and 56 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ destructor := func(value net.Conn) {
}
maxPoolSize := 10
pool := puddle.NewPool(constructor, destructor, maxPoolSize)
pool := puddle.NewPool[net.Conn](&puddle.Config[int]{Constructor: constructor, Destructor: destructor, MaxSize: maxPoolSize})
// Acquire resource from the pool.
res, err := pool.Acquire(context.Background())