Registry / utility / jolestar-go-commons-pool-v2

jolestar-go-commons-pool-v2

JSON →
library2.1.2gogounverified

A generic object pool library for Go, inspired by Apache Commons Pool.

go get github.com/jolestar/go-commons-pool/v2
INSTALL
IMPORT
SIG · JOLESTAR-GO-COMMON
J
jolestar-go-commons-pool-v2
utilitygov2.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pool
✓ github.com/jolestar/go-commons-pool/v2

Creates an object pool, borrows and returns an object.

package main import ( "fmt" "github.com/jolestar/go-commons-pool/v2" ) func main() { factory := pool.NewPooledObjectFactorySimple( func() (interface{}, error) { return "object", nil }, ) p := pool.NewObjectPoolWithDefaultConfig(factory) obj, _ := p.BorrowObject() fmt.Println(obj.(string)) p.ReturnObject(obj) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
2.1.2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
9
Resources
jolestar-go-commons-pool-v2 — go get jolestar-go-commons-pool-v2 · libregistry