datafuselabs / openraft

rust raft with improvements
Apache License 2.0
1.35k stars 150 forks source link

add c api support #506

Open calvin2021y opened 2 years ago

calvin2021y commented 2 years ago

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

github-actions[bot] commented 2 years ago

👋 Thanks for opening this issue!

Get help or engage by:

Licenser commented 2 years ago

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

calvin2021y commented 2 years ago

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

Licenser commented 2 years ago

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)

calvin2021y commented 2 years ago

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