This is necessary in order to have a clean event loop quit
It seems like only the part of this change needed to exit cleanly is removing the racy event_base_loopexit
added in #11006. Aside from that, it looks like the previous code would also exit cleanly, unless it took longer than 2 seconds.
If the 2 second timeout causes problems, maybe it could be increased, but it doesn’t seem like seem like a great idea to me to delay shutdown forever writing data to clients. It also seems nicer that the previous code didn’t need an inexplicable windows workaround.
On the other hand, if we really do want to wait forever here instead of timing out, it would be good to delete the std::future/std::packaged_task code added in 755aa05174e06effd758eeb78c5af9fb465e9611, since now it is sitting there unused.