Open vicanso opened 3 months ago
I want to use pingora as a reverse proxy module, I don't want to restart the program by way to load the new configuration. So I just need to close server1 and run server2, which as follows:
Is it feasible?
That should be possible. That is how internally we do the graceful restart. But the code is coupled with signal handling for now. Maybe someone can refactor that code to decouple them.
Also want run_forever
return a anyhow::Result<()>
instead of block_on(self.main_loop())
, which will be panic when tokio::spawn
, with below error:
Cannot start a runtime from within a runtime. This happens because a function (like `block_on`) attempted to block the current thread while the thread is being used to drive asynchronous tasks.
What is the problem your feature solves, or the need it fulfills?
I use
pingora
as a lib for my reverse proxy , butrun_forever
function will callstd::process::exit(0);
. I expect close the http server only, but not exit the program,.Describe the solution you'd like
Support parameter to set not exit the program for
run_forever
function.