Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

research: How to support async API for C binding? #1741

Open
Xuanwo opened this issue Mar 23, 2023 · 4 comments
Open

research: How to support async API for C binding? #1741

Xuanwo opened this issue Mar 23, 2023 · 4 comments

Comments

@Xuanwo
Copy link
Member

Xuanwo commented Mar 23, 2023

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

@messense
Copy link
Member

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

@nasen23
Copy link
Contributor

nasen23 commented Apr 2, 2023

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

@Xuanwo
Copy link
Member Author

Xuanwo commented Apr 2, 2023

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

@xyjixyjixyji
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants