deleting a pool or changing the size of a pool #8

pheaver opened this Issue Jun 30, 2012 · 2 comments


None yet
2 participants

pheaver commented Jun 30, 2012

There seems to be no way to delete a pool (i.e. delete all resources in a pool), because there is no way to know how many allocated resources there are in a pool. I could try to apply takeResource/destroyResource over and over, but there's no way to know when to stop. If I could query for the number of allocated resources, then I would know when to stop.

My use case is that the size of the resource pool may change at runtime, so I need to create a new pool and destroy all resources in the old pool. However, if resource-pool supported changing the size at runtime, then I could just use that instead of destroying and creating the pool.


basvandijk commented May 7, 2014

@pheaver, we could support changing the size of the pool at runtime by making the maxResources an IORef Int.

What do you think should happen when you lower the maxResources below the inUse counter of one of the stripes? What happens to the idle resources? What happens to the taken resources? What happens when the taken resources are put back into the pool?

pheaver commented May 7, 2014

Hi, I'm not using this package anymore, so I don't have any opinions about this feature :).

pheaver closed this May 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment