Package stormpot

Examples of stormpot.Timeout


  public static void main(String[] args) throws InterruptedException {
    // tag::usageMyApp[]
    MyAllocator allocator = new MyAllocator();
    Config<MyPoolable> config = new Config<MyPoolable>().setAllocator(allocator);
    Pool<MyPoolable> pool = new BlazePool<MyPoolable>(config);
    Timeout timeout = new Timeout(1, TimeUnit.SECONDS);

    MyPoolable object = pool.claim(timeout);
    try {
      // Do stuff with 'object'.
      // Note that 'claim' will return 'null' if it times out!
View Full Code Here

TOP

Related Classes of stormpot.Timeout

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.