public Pool(int startSize, IBurstStrategy burstStrategy, IPooledItemFactory <T> fillStrategy) { _burstStrategy = burstStrategy; Count = startSize; _fillStrategy = fillStrategy; Initialize(); }
public UnboundedPool(string instanceName, IPooledItemFactory <TItem> factory, Bounds bounds, EvictionCriteria criteria) : base(instanceName, factory, new LinkedQueue <TimeRecord <TItem> >(), criteria) { this.bounds = bounds; PreFill(); }
public BoundedPool(string instanceName, IPooledItemFactory <TItem> factory, Bounds bounds, EvictionCriteria criteria) : base(instanceName, factory, new BoundedLinkedQueue <TimeRecord <TItem> >(bounds.MaxCount), criteria) { this.bounds = bounds; PreFill(); DeadItem += OnDeadItem; }
protected AbstractPool(string instanceName, IPooledItemFactory <TItem> factory, Threading.IQueue <TimeRecord <TItem> > pool, EvictionCriteria evictionCriteria) { this.instanceName = instanceName; this.factory = factory; this.pool = pool; this.evictionCriteria = evictionCriteria; // setup eviction timer evictionTimer = new Timer(); evictionTimer.Interval = evictionCriteria.Interval.TotalMilliseconds; evictionTimer.Elapsed += EvictIdleItems; evictionTimer.Start(); // item leak timer leakTimer = new Timer(); leakTimer.Interval = 1000; leakTimer.Elapsed += ProcessLeakedItems; leakTimer.Start(); }
private void PrepareInterfaces() { _burstStrategy = new BurstStrategy(); _fillStrategy = new FillStrategy(); }
public Pool(int startSize, IPooledItemFactory <T> fillStrategy) { _fillStrategy = fillStrategy; Count = startSize; Initialize(); }