Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
pheaver opened this Issue · 2 comments

2 participants

@pheaver

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
Collaborator

@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

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

@pheaver pheaver closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.