Package org.apache.thrift.async

Examples of org.apache.thrift.async.TAsyncClient


    ThriftClientPool<TAsyncClient> pool = new ThriftClientPool<TAsyncClient>(
        new MockedMakerFactory());
    assertEquals(0, pool.getNumIdle(sock));
    assertEquals(0, pool.getNumActive(sock));

    TAsyncClient client1 = pool.borrowClient(sock);
   
    assertEquals(0, pool.getNumIdle(sock));
    assertEquals(1, pool.getNumActive(sock));
   
    pool.returnClient(sock, client1);
   
    assertEquals(1, pool.getNumIdle(sock));
    assertEquals(0, pool.getNumActive(sock));
   
    TAsyncClient client2 = pool.borrowClient(sock);

    assertEquals(0, pool.getNumIdle(sock));
    assertEquals(1, pool.getNumActive(sock));
   
    assertEquals(client1, client2);
View Full Code Here


        new MockedMakerFactory(), conf);
   
    assertEquals(0, pool.getNumIdle(sock));
    assertEquals(0, pool.getNumActive(sock));
   
    TAsyncClient client = pool.borrowClient(sock);
   
    assertEquals(0, pool.getNumIdle(sock));
    assertEquals(1, pool.getNumActive(sock));
   
    pool.returnClient(sock, client);
View Full Code Here

TOP

Related Classes of org.apache.thrift.async.TAsyncClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.