chriskohlhoff / asio

Asio C++ Library
http://think-async.com/Asio
4.72k stars 1.19k forks source link

Support combine with other event loops #1497

Open shuai132 opened 1 week ago

shuai132 commented 1 week ago

I am very eager for ASIO to be used in combine with other event loops. For instance, when using Node.js (libuv), I also want to use some ASIO-based libraries. To avoid potential issues, it is best to handle all these asynchronous tasks in a single thread.

It would be really cool and useful if we could run libuv and ASIO simultaneously in the same thread!!!

This submission represents the implementation approach I've come up with so far. It has been successfully tested on macOS, but not yet on other platforms. Of course, there may be better solutions. Do you have any suggestions or comments? I would be very happy to supplement and improve this, or adopt a different approach.

@chriskohlhoff