Newer
Older
pub fn global() -> traft::Result<&'static Node> {
// Uninitialized raft node is a regular case. This case may take
// place while the instance is executing `start_discover()` function.
// It has already started listening, but the node is only initialized
// in `postjoin()`.
unsafe { RAFT_NODE.as_deref() }.ok_or(Error::Uninitialized)
crate::collect_proc!(proc_raft_interact);
fn proc_raft_interact(pbs: Vec<traft::MessagePb>) -> traft::Result<()> {
crate::tarantool::fiber_name("proc_raft_interact");
node.step_and_yield(raft::Message::try_from(pb).map_err(Error::other)?);