Package org.redisson.core

Examples of org.redisson.core.RCountDownLatch.await()


        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    Assert.assertEquals(1, latch.getCount());
                    boolean res = latch.await(550, TimeUnit.MILLISECONDS);
                    Assert.assertTrue(res);
                } catch (InterruptedException e) {
                    Assert.fail();
                }
            }
View Full Code Here


        executor.execute(new Runnable() {
            @Override
            public void run() {
                try {
                    Assert.assertEquals(1, latch.getCount());
                    boolean res = latch.await(500, TimeUnit.MILLISECONDS);
                    Assert.assertFalse(res);
                } catch (InterruptedException e) {
                    Assert.fail();
                }
            }
View Full Code Here

        RCountDownLatch latch = redisson.getCountDownLatch("latch");
        latch.trySetCount(1);
        Assert.assertEquals(1, latch.getCount());
        latch.countDown();
        Assert.assertEquals(0, latch.getCount());
        latch.await();
        latch.countDown();
        Assert.assertEquals(0, latch.getCount());
        latch.await();
        latch.countDown();
        Assert.assertEquals(0, latch.getCount());
View Full Code Here

        latch.countDown();
        Assert.assertEquals(0, latch.getCount());
        latch.await();
        latch.countDown();
        Assert.assertEquals(0, latch.getCount());
        latch.await();
        latch.countDown();
        Assert.assertEquals(0, latch.getCount());
        latch.await();

        RCountDownLatch latch1 = redisson.getCountDownLatch("latch1");
View Full Code Here

        latch.countDown();
        Assert.assertEquals(0, latch.getCount());
        latch.await();
        latch.countDown();
        Assert.assertEquals(0, latch.getCount());
        latch.await();

        RCountDownLatch latch1 = redisson.getCountDownLatch("latch1");
        latch1.trySetCount(1);
        latch1.countDown();
        Assert.assertEquals(0, latch.getCount());
View Full Code Here

        latch1.trySetCount(1);
        latch1.countDown();
        Assert.assertEquals(0, latch.getCount());
        latch1.countDown();
        Assert.assertEquals(0, latch.getCount());
        latch1.await();

        RCountDownLatch latch2 = redisson.getCountDownLatch("latch2");
        latch2.trySetCount(1);
        latch2.countDown();
        latch2.await();
View Full Code Here

        latch1.await();

        RCountDownLatch latch2 = redisson.getCountDownLatch("latch2");
        latch2.trySetCount(1);
        latch2.countDown();
        latch2.await();
        latch2.await();

        RCountDownLatch latch3 = redisson.getCountDownLatch("latch3");
        Assert.assertEquals(0, latch.getCount());
        latch3.await();
View Full Code Here

        RCountDownLatch latch2 = redisson.getCountDownLatch("latch2");
        latch2.trySetCount(1);
        latch2.countDown();
        latch2.await();
        latch2.await();

        RCountDownLatch latch3 = redisson.getCountDownLatch("latch3");
        Assert.assertEquals(0, latch.getCount());
        latch3.await();
View Full Code Here

        latch2.await();
        latch2.await();

        RCountDownLatch latch3 = redisson.getCountDownLatch("latch3");
        Assert.assertEquals(0, latch.getCount());
        latch3.await();

        RCountDownLatch latch4 = redisson.getCountDownLatch("latch4");
        Assert.assertEquals(0, latch.getCount());
        latch4.countDown();
        Assert.assertEquals(0, latch.getCount());
View Full Code Here

        RCountDownLatch latch4 = redisson.getCountDownLatch("latch4");
        Assert.assertEquals(0, latch.getCount());
        latch4.countDown();
        Assert.assertEquals(0, latch.getCount());
        latch4.await();

        redisson.shutdown();
    }

}
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.