import std.stdio; import core.thread : Fiber; void foo(){ writeln("Hello"); Fiber.yield(); writeln("World"); } void test5_spawner(){ auto f = new Fiber(&foo); //f.call(); // Hello //f.call(); // World while(f.state != Fiber.State.TERM){ f.call(); } } /* ./vtest2 hello here! Hello World */