1- // Copyright 2024 FishGoddess. All rights reserved.
1+ // Copyright 2025 FishGoddess. All rights reserved.
22// Use of this source code is governed by a MIT style
33// license that can be found in the LICENSE file.
44
@@ -36,7 +36,7 @@ func newPoolClosedErr(ctx context.Context) error {
3636func main () {
3737 // Create a pool with limit and fast-failed so it will return an error immediately instead of waiting.
3838 ctx := context .Background ()
39- pool := rego .New [ int ]( acquire , release , rego . WithLimit ( 1 ) , rego .WithFastFailed ())
39+ pool := rego .New ( 1 , acquire , release , rego .WithFastFailed ())
4040
4141 // Take one resource from pool which is ok.
4242 resource , err := pool .Take (ctx )
@@ -56,7 +56,7 @@ func main() {
5656 fmt .Println (resource , err , err == rego .ErrPoolIsClosed )
5757
5858 // Create a pool with limit and fast-failed and new error funcs.
59- pool = rego .New [ int ]( acquire , release , rego . WithLimit ( 1 ) , rego .WithFastFailed (), rego .WithPoolFullErr (newPoolFullErr ), rego .WithPoolClosedErr (newPoolClosedErr ))
59+ pool = rego .New ( 1 , acquire , release , rego .WithFastFailed (), rego .WithPoolFullErr (newPoolFullErr ), rego .WithPoolClosedErr (newPoolClosedErr ))
6060
6161 // Take one resource from pool which is ok.
6262 resource , err = pool .Take (ctx )
0 commit comments