IPool.setLimit

Sets the limit of number of items in pool or disables limitation for limit = unlimited. When limiting the pool, any excess idle items are reset and deleted.

class IPool
override
size_t
setLimit
(
size_t limit
)
out { debug(ObjectPoolConsistencyCheck) foreach (item; this.items) { assert (item.ptr !is null); } }

Parameters

limit size_t

new limit of number of items in pool; unlimited disables limitation

Return Value

Type: size_t

new limit

Throws

LimitExceededException if the number of busy pool items exceeds the desired limit.

Meta