Package co.paralleluniverse.fibers

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


        assertThat(m1, equalTo(2));
        assertThat(m2, equalTo(4));
        assertThat(m3, is(nullValue()));

        fib.join();
    }

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


        ch.send(3);
        ch.send(4);
        ch.send(5);
        ch.close();

        fib.join();
    }

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

                ch1.close();
            }
        }).start();

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

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

        ch1.send(3);
        ch1.send(4);
        ch1.send(5);
        ch1.close();

        fib.join();
    }

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

        assertThat(m1, equalTo(2));
        assertThat(m2, equalTo(4));
        assertThat(m3, is(nullValue()));

        fib.join();
    }

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

        ch1.send(3);
        ch1.send(4);
        ch1.send(5);
        ch1.close();

        fib.join();
    }

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

        ch.send(3);
        ch.send(4);
        ch.send(5);
        ch.close();

        fib.join();
    }

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

        ch1.send(3);
        ch1.send(4);
        ch1.send(5);
        ch1.close();

        fib.join();
    }

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

        ch2.send(2);
        ch1.send("c");
        ch2.send(3);
        ch1.send("foo");
        ch2.close();
        fib.join();
    }

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

        ch2.send(2);
        ch1.send("c");
        ch2.send(3);
        ch1.send("foo");
        ch2.close();
        fib.join();
    }

    @Test
    public void testFlatmapThreadToFiber() throws Exception {
        final Channel<Integer> ch1 = 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.