Examples of BerkleyQueue


Examples of com.googlecode.flaxcrawler.concurrent.BerkleyQueue

    }

    @Test
    @Ignore
    public void testBerkleyQueue() {
        BerkleyQueue queue = new BerkleyQueue("stats");
        try {
            queue.setQueueCapacity(500);

            for (int i = 0; i < 1000; i++) {
                queue.add(new TestTask("tratatatat"));
            }

            for (int i = 0; i < 1000; i++) {
                Object obj = queue.poll();
                assertNotNull(obj);
            }

            assertNull(queue.poll());
        } finally {
            queue.dispose();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.