opendal icon indicating copy to clipboard operation
opendal copied to clipboard

research: How to support async API for C binding?

Open Xuanwo opened this issue 2 years ago • 5 comments

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

Xuanwo avatar Mar 23 '23 13:03 Xuanwo

We can probably learn from hyper: https://github.com/hyperium/hyper/tree/master/src/ffi

messense avatar Mar 24 '23 01:03 messense

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🥹.

nasen23 avatar Apr 02 '23 12:04 nasen23

Go ahead and have fun! Maybe we can start with blocking api first.

Xuanwo avatar Apr 02 '23 14:04 Xuanwo

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.

  1. Focus on the memory operator first, making it full-fledged.
  2. Support other services, but only for blocking services.
  3. Support the async operations.

Any ideas?

xyjixyjixyji avatar Apr 08 '23 12:04 xyjixyjixyji

Track: #5366 #2959

kassane avatar Mar 11 '25 11:03 kassane