Sorry for the late reply, I had overlooked the thread in my mail reader.

  1. My first question is, as the distributed setting had been deprecated back then since 0.8.1, what is the current recommended approach to enable multiple threads processing and handling the HTTP requests in a single instance of my server?

I would say runWorkerTaskDist and then setting up a server in each worker task is the way to go. runWorkerTask also attempts to make sure that no unshared data is shared between the threads by enforcing shared being used correctly.

runWorkerTask({
    auto router = new URLRouter;
    // ...
    
    listenHTTP(router, ":8080");
});
  1. My next question is, for the sake of debugging the process of page generation (from the programmer's perspective, who writes code in a designed interpreted language on my platform), I would need to push the debugged HTTP response generation (request handler) to its own worker thread. What would you recommend in order to move the processing from within the request handler (i.e. void req_hnd(req, res)) to its own thread, where it can wait for the debugging and introspection commands sent from the programmer (using web IDE of my very platform)?

I understand, the answer may be very general, however, the second problem comes down to a simple task: from within the request handler with populated HttpServerRequest and HttpServerResponse data structures on its input, how to reallocate the current Task to another Thread, where this other Thread would yield immediately (and the response for starting the debugged process would be generated independently on the response generated by the debugged process), whereas the output of the process being debugged would be collected later upon explicit request?

Tasks and the HTTPServerRequest/HTTPServerResponse, as well as the underlying TCPConnection are all inherently thread local, so moving those to another thread is not possible. However you approach this, you will have to proxy the data between the two threads instead. There is vibe.stream.taskpipe that can be used to transfer the bodyWriter/bodyReader data between the threads.

Ideally you would only process parts of the debugging code that actually block the calling thread in a separate worker task (e.g. using vibe.core.concurrency.performInWorker) and perform the rest of the debug session in the original request handler task.

I don't think I understood the debugging setup well enough to make a qualified comment, so I kept the answer a bit more general here.