コード例 #1
0
        public void FetchChannelToWorkWith_WhenCalled_AsksPoolBorrow()
        {
            Service channel = new Service();

            Expect.Call(pool.BorrowObject()).Return(channel);
            repo.ReplayAll();

            var result = CreatePoolManager().FetchChannelToWorkWith();

            Assert.AreSame(result, channel);
        }
コード例 #2
0
 /// <summary>
 /// Builds a new <see cref="PooledObjectHolder"/>
 /// trying to borrow an object form it
 /// </summary>
 /// <param name="pool"></param>
 private PooledObjectHolder(IObjectPool pool)
 {
     this.pool = pool;
     this.pooled = pool.BorrowObject();
 }
コード例 #3
0
 /// <exception cref="System.Exception"></exception>
 public void Run()
 {
     pool.BorrowObject();
 }
コード例 #4
0
 public void UsePool()
 {
     gotFromPool = objectPool.BorrowObject();
     latch.Release();
 }
コード例 #5
0
 /// <summary>
 /// Builds a new <see cref="PooledObjectHolder"/>
 /// trying to borrow an object form it
 /// </summary>
 /// <param name="pool"></param>
 private PooledObjectHolder(IObjectPool pool)
 {
     this.pool   = pool;
     this.pooled = pool.BorrowObject();
 }