I'm working on a C library that features a background io thread and I think that libuv is a great choice for this task. The io thread will be responsible for handling a pool of tcp connections. The library will be used to write higher-level language bindings and will expose both tradition and asynchronous apis.
I know that a proper way to communicate with a libuv event loop from a different thread is by using uv_async_t
object. However, there is, as far as I can tell, no primitive for communication with some other thread(s) from the event loop thread.
For this exact reason, I propose a new primitiv - uv_promise_t
. And I've included description of its api in this gist.
The goal is to make building apis like Cassandra Java Driver on top of libuv a breeze.