Hello,
I have built a software development platform on top of vibe.d. The platform has its engine that processes HTTP requests and generates HTTP responses. Apart from statically served files, it runs all page generation tasks in a single thread (in a cooperative multitasking using vibe.d Fibers).
- 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? - 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?
Thank you very much for your hints.
Kind regards,
Ľudovít