type TestResource struct {
id int64
closed bool
}
func(tr TestResource) Close() {
if !tr.closed {
count.Add(-1)
tr.closed = true
}
}
func ResourceFactory() (Resource, error) {
count.Add(1)
return TestResource{lastId.Add(1), false}, nil
}
func main(){
pool := NewResourcePool(ResourceFactory, 10, 10, time.Second)
}
-
Notifications
You must be signed in to change notification settings - Fork 0
resourcepool
License
ysh0566/resourcepool
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
resourcepool
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published