Package co.paralleluniverse.fibers

Examples of co.paralleluniverse.fibers.Fiber.join()


        ch.close(new Exception("foo"));

        ch.send(6);
        ch.send(7);

        fib.join();
    }

    @Test
    public void whenChannelClosedThenBlockedSendsComplete() throws Exception {
        assumeThat(policy, is(OverflowPolicy.BLOCK));
View Full Code Here


        Thread.sleep(500);

        ch.close();
        fib1.join();
        fib2.join();
    }

    @Test
    public void whenChannelClosedExceptionThenBlockedSendsComplete() throws Exception {
        assumeThat(policy, is(OverflowPolicy.BLOCK));
View Full Code Here

        Thread.sleep(500);

        ch.close(new Exception("foo"));
        fib1.join();
        fib2.join();
    }

    @Test
    public void testPrimitiveChannelClose() throws Exception {
        assumeThat(mailboxSize, not(equalTo(0)));
View Full Code Here

        ch.close();

        ch.send(6);
        ch.send(7);

        fib.join();
    }

    @Test
    public void testPrimitiveChannelCloseException() throws Exception {
        assumeThat(mailboxSize, not(equalTo(0)));
View Full Code Here

        ch.close(new Exception("foo"));

        ch.send(6);
        ch.send(7);

        fib.join();
    }

    @Test
    public void testTopic() throws Exception {
        final Channel<String> channel1 = newChannel();
View Full Code Here

        Thread.sleep(100);
        topic.send("world!");

        f1.join();
        f2.join();
        f3.join();
    }

    @Test
    public void testChannelGroupReceive() throws Exception {
        final Channel<String> channel1 = newChannel();
View Full Code Here

        if (policy != OverflowPolicy.BLOCK) {
            channel1.send("goodbye"); // TransferChannel will block here
            Thread.sleep(100);
        }
        channel2.send("world!");
        fib.join();
    }

    @Test
    public void testChannelGroupReceiveWithTimeout() throws Exception {
        final Channel<String> channel1 = newChannel();
View Full Code Here

        channel3.send("hello");
        Thread.sleep(100);
        channel2.send("world!");
        Thread.sleep(100);
        channel1.send("foo");
        fib.join();
    }
}
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.