Package co.paralleluniverse.fibers

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


        server.start();
        Thread.sleep(100);
        client.start();

        client.join();
        server.join();
    }

    @Test
    public void testFiberAsyncFile() throws Exception {
View Full Code Here


        ch1.send(3);
        ch1.send(4);
        Strand.sleep(50);
        ch1.send(5);
        ch1.close();
        fib.join();
    }

    @Test
    public void testFiberTransform1() throws Exception {
        final Channel<Integer> in = newChannel();
View Full Code Here

                in.close();
            }
        }).start();

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

    @Test
    public void testFlatmapSendThreadToFiber() throws Exception {
        final Channel<Integer> ch = newChannel();
View Full Code Here

        ch1.send(2);
        ch1.send(3);
        ch1.send(4);
        ch1.send(5);
        ch1.close();
        fib.join();
    }

    //@Test
    public void testFlatmapSendWithTimeoutsThreadToFiber() throws Exception {
        final Channel<Integer> ch = newChannel();
View Full Code Here

        ch1.send(3);
        ch1.send(4);
        Strand.sleep(50);
        ch1.send(5);
        ch1.close();
        fib.join();
    }

    @Test
    public void testForEach() throws Exception {
        final Channel<Integer> ch = newChannel();
View Full Code Here

        channel1.send("hello");
        Thread.sleep(200);

        channel3.send("world!");

        fib.join();
    }

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

        }).start();

        channel1.send("hello");
        channel3.send("world!");

        fib.join();
    }

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

        }).start();

        Thread.sleep(200);
        channel3.close();

        fib.join();
    }

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

            }
        }).start();

        channel3.close();

        fib.join();
    }

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

        Thread.sleep(200);

        channel1.send("hello");

        fib.join();
    }

    @Test
    public void testSelectReceiveWithTimeoutChannel() throws Exception {
        final Channel<String> channel1 = newChannel();
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.