openraft icon indicating copy to clipboard operation
openraft copied to clipboard

add c api support

Open calvin2021y opened this issue 3 years ago • 5 comments

please consider add c api header file support, so it can be used as https://github.com/canonical/raft replacement.

calvin2021y avatar Aug 08 '22 07:08 calvin2021y

👋 Thanks for opening this issue!

Get help or engage by:

  • /help : to print help messages.
  • /assignme : to assign this issue to you.

github-actions[bot] avatar Aug 08 '22 07:08 github-actions[bot]

Been through this in a different place, since openraft is heavily async it will translate extremely poorly to c-land

Licenser avatar Aug 10 '22 08:08 Licenser

wrapper it with struct like https://github.com/datastax/cpp-driver future will be a option.

calvin2021y avatar Aug 10 '22 09:08 calvin2021y

The problem is that futures in rust and c are very differently implemented you can't just take a rust future and run it in a c asynchronous runtime (or vice versa)

Licenser avatar Aug 10 '22 10:08 Licenser

Is is possible to wrapper rust future with C struct and pass into libuv envet loop (or uv_async_t)?

calvin2021y avatar Aug 11 '22 09:08 calvin2021y