Skip to main content

Crate openraft_rt_monoio

Crate openraft_rt_monoio 

Source
Expand description

This crate provides a MonoioRuntime type, which has AsyncRuntime implemented so that you can use Openraft with Monoio.

pub struct TypeConfig {}

impl openraft::RaftTypeConfig for TypeConfig {
    // Other type are omitted

    type AsyncRuntime = openraft_rt_monoio::MonoioRuntime;
}

§NOTE

  1. For the Openraft dependency used with this crate
    1. You can disable the default feature as you don’t need the built-in Tokio runtime.
    2. The single-threaded feature needs to be enabled or this crate won’t work.
  2. With the single-threaded feature enabled, the handle type Raft will be no longer Send and Sync.
  3. Even though this crate allows you to use Monoio, it still uses some primitives from Tokio
    1. Watch: Monoio (or local_sync) does not have a watch channel.
    2. Mutex: Monoio does not provide a Mutex implementation.

Structs§

MonoioRuntime
AsyncRuntime implementation for Monoio.