IPool.get_

Takes an idle item from the pool or creates a new one if all items are busy or the pool is empty.

class IPool
protected
get_
()
out (_item_out) { auto item_out = cast(Item)_item_out; assert (!this.isNull(item_out)); assert (this.isSame(item_out, this.items[this.num_busy_ - 1])); debug(ObjectPoolConsistencyCheck) { foreach (item; this.items[0 .. this.num_busy_ - 1]) { assert (!this.isSame(item, item_out)); } if (this.num_busy_ < this.items.length) { foreach (item; this.items[this.num_busy_ + 1 .. $]) { assert (!this.isSame(item, item_out)); } } } }

Parameters

new_item Item

expression that creates a new Item instance

Return Value

Type: Item

pool item

Throws

LimitExceededException if limitation is enabled and all pool items are busy

Meta