One thing I never really understood is how you do asynchronous IO
with Go's goroutines or D's fibers. The callback model of Node.js
is pretty simple:

fs.readFile(fileName, function(data) {

  use(data);

});

The function returns immediately after invocation and processing
goes back to the event loop, until at some point data is read and
clojure is being invoked. The downside of this approach is
obviously that we cannot right sequential code anymore and
anything more complicated quickly becomes a mess.

Now, my understanding of Vibe's implementation is that incoming
requests are handled in individual Fibers, each of them has it's
own stack and so on. So when in the request handler we invoke an
IO function, my understanding that it should call yield() which
will return it back to the event loop while maintaining the state
of that fiber. Once the operation is ready to continue it will
resume the fiber. This brings me to the two questions:

  1. I/O functions in Phobos are not Fiber-aware, so we will have
    to have our own set of I/O operations, is that correct?
  2. How exactly does it resume the fiber after yield()?

Cheers,
Eldar