research: How to support async API for C binding?
So far, I have no idea on how to support async API in C, we need some research and help from community.
https://en.cppreference.com/w/cpp/thread/async https://www.boost.org/doc/libs/1_76_0/doc/html/boost_asio.html
We can probably learn from hyper: https://github.com/hyperium/hyper/tree/master/src/ffi
Is c binding being worked on? I think I could get my hands on some harder work. Please assign this to me if no one else is working on it. It might take quite some time though🥹.
Go ahead and have fun! Maybe we can start with blocking api first.
It seems hyper let async task returns a Future, and used push_executors to push them to the executors, which further poll the task until completion.
Looks like a minimal async runtime in C 🤣 🤣 🤣 , anyone interested could check this for more details.
I think now maybe the C binding could be developed in the following order, and we still have plenty of time to think about our implementation of async operation.
- Focus on the
memoryoperator first, making it full-fledged. - Support other services, but only for blocking services.
- Support the async operations.
Any ideas?
Track: #5366 #2959