vibe.d is blocking threads

yawniek via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Apr 27 12:32:53 PDT 2016


On Wednesday, 27 April 2016 at 13:00:29 UTC, RuZzz wrote:
> Code:
>     import std.concurrency;
>     import core.thread;
>     //import vibe.http.client;      // If uncommented this 
> line, the thread "worker" does not start
>     void worker() {
>         foreach (i; 0 .. 5) {
>             Thread.sleep(500.msecs);
>             writeln(i, " (worker)");
>         }
>     }
>
> [...]

you should use the built in concurrency primitives vibe.d offers.
especially runTask and runWorkerTask.
see the vibe.d examples and http://vibed.org/features


More information about the Digitalmars-d-learn mailing list