Search in sources :

Example 1 with TestInterface2

use of co.paralleluniverse.common.test.TestInterface2 in project quasar by puniverse.

the class DynamicallyLoadedSuspendable method test.

@Suspendable
public void test(ArrayList<String> results) {
    results.add("a");
    TestInterface referencedSuspend = new ReferencedSuspendable();
    TestInterface2 indirectSuspend = new IndirectSuspendable();
    results.add("b");
    try {
        results.add("c");
        Fiber.park();
        results.add("d");
    } catch (SuspendExecution ex) {
    }
    results.add("e");
    referencedSuspend.test(results);
    results.add("f");
    indirectSuspend.test(results, referencedSuspend);
    results.add("g");
    while (true) {
        results.add("h");
        indirectSuspend.test(results, referencedSuspend);
        results.add("i");
    }
}
Also used : SuspendExecution(co.paralleluniverse.fibers.SuspendExecution) TestInterface(co.paralleluniverse.common.test.TestInterface) TestInterface2(co.paralleluniverse.common.test.TestInterface2) Suspendable(co.paralleluniverse.fibers.Suspendable)

Aggregations

TestInterface (co.paralleluniverse.common.test.TestInterface)1 TestInterface2 (co.paralleluniverse.common.test.TestInterface2)1 SuspendExecution (co.paralleluniverse.fibers.SuspendExecution)1 Suspendable (co.paralleluniverse.fibers.Suspendable)1