ringabout/httpx

Allow multiple servers running in parallel async

mildred opened this issue · 1 comments

Currently, running an httpx server is blocking. I have a use case where I must run multiple servers on multiple ports (admin API plus general purpose HTTP). I'm using asynchttpserver and asyncdispatch, but I'd prefer to use prologue and httpx.

Is there a reason why this could not be implemented in httpx, and are you opened to PRs about this?

Related prologue issue: planety/prologue#105

Looking at the code the implementation would be :

  • for multi threaded scenarios: instead of joining threads in the run proc, it should run a future that complete when all threads are finished
  • for simple threaded scenarios: the event loop should be async, or more easily use a single thread and fall back to previous case