Feature: Monoio Runtime
Is your feature request related to a problem? Please describe.
I want to use openraft with monoio.
Describe the solution you'd like
A feature flag with a MonoioAsyncRuntime available.
Additional context
I started a draft over this on https://github.com/datafuselabs/openraft/pull/1010 but there are some issues:
-
is_panic&abortcan be a little more complex to implement as inmonoioand when you useio-uringyou register to the kernel when you start reading/writing with fd. For monoio, you have to pass aCanceller. to be mapped on the operation you do on those IO to be able to have a proper cancellation.
👋 Thanks for opening this issue!
Get help or engage by:
-
/help: to print help messages. -
/assignme: to assign this issue to you.
AsyncRuntime::abort() is not mandatory and can be removed:
- #1012
monoio is a little bit different about is_panic: AFAIK it's a single-threaded runtime(the future to run need no Send):
If it panics, the runtime just destroyed. There won't be any other task to examine the JoinHandle of the task in the destroyed runtime. And if send the JoinHandle to another thread(also another monoio runtime) to poll it with JoinHandle.await, there looks like to be some bug: it has chance to block forever:
- https://github.com/bytedance/monoio/issues/241
Because of this issue, I can not tell what JoinHandle.await gets when the corresponding task panics.
Meanwhile, according to the API doc, monoio JoinHandle.await does not return a Result, MonoioRuntime::is_panic() could just return false.