static RecyclablePooledFactoriesAndChannels_OpenOnce() { s_recyclablePooledFactoriesAndChannels = StaticDisposablesHelper.AddDisposable( new PoolOfThings <FactoryAndPoolOfItsObjects <ChannelFactory <WcfService1.IService1>, OpenOnceChannelWrapper <WcfService1.IService1> > >( maxSize: 3, // # of pooled FactoryAndPoolOfItsObjects createInstance: () => new FactoryAndPoolOfItsObjects <ChannelFactory <WcfService1.IService1>, OpenOnceChannelWrapper <WcfService1.IService1> >( createFactoryInstance: () => TestHelpers.CreateChannelFactory <WcfService1.IService1>(TestHelpers.CreateEndPointAddress(), TestHelpers.CreateBinding()), destroyFactoryInstance: (chf) => s_CloseFactoryStats.CallActionAndRecordStats(() => TestHelpers.CloseFactory(chf)), maxPooledObjects: 3, // # of pooled channels within each pooled FactoryAndPoolOfItsObjects createObject: (chf) => s_CreateChannelStats.CallFuncAndRecordStats(func: () => new OpenOnceChannelWrapper <WcfService1.IService1>(TestHelpers.CreateChannel(chf))), destroyObject: (chWr) => s_CloseChannelStats.CallActionAndRecordStats(action: () => TestHelpers.CloseChannel(chWr.Channel)) ), destroyInstance: (_fapoic) => _fapoic.Destroy())); }
public AllPooledInstancesCollection(PoolOfThings <T> thePool) { _thePool = thePool; }