Pool<A, E> is a pool of items of type A, each of which may be associated with the acquisition and release of resources. An attempt to get an item from a pool may fail with an error of type E.
Type
Pool<A, E> represents a resource pool that manages the lifecycle of items.
Creating Pools
make
Creates a fixed-size pool with the specified number of items.make with concurrency
acquire: Effect to create a new itemsize: Number of items in the poolconcurrency: Permits per item (default: 1)targetUtilization: When to create new items (0-1, default: 1)
makeWithTTL
Creates a pool with time-to-live for items.acquire: Effect to create a new itemmin: Minimum number of itemsmax: Maximum number of itemstimeToLive: How long items livetimeToLiveStrategy:"usage"(default) or"creation"concurrency: Permits per item (default: 1)targetUtilization: When to create new items (0-1, default: 1)