Appending inputs to the WAL is handled by the following code snippet, which is blocking:
|
Effect::WalAppend(height, entry, r) => { |
|
self.wal_append(height, entry, state.phase).await?; |
|
Ok(r.resume_with(())) |
|
} |
which ends up in the following call to the actor/thread operating the WAL, which is also synchronous:
let result = ractor::call!(self.wal, WalMsg::Append, height, entry);
The write action performed by the WalMsg::Append message, however, is asynchronous by definition, as synchronous writes, which are less frequent use the WalMsg::Flush message.
The main reason to make the consensus routine to wait for the reply of the WAL routine is error handling. But this possibly can be implemented in a more efficient way.
Appending inputs to the WAL is handled by the following code snippet, which is blocking:
malachite/code/crates/engine/src/consensus.rs
Lines 1348 to 1351 in ba38f41
which ends up in the following call to the actor/thread operating the WAL, which is also synchronous:
The write action performed by the
WalMsg::Appendmessage, however, is asynchronous by definition, as synchronous writes, which are less frequent use theWalMsg::Flushmessage.The main reason to make the consensus routine to wait for the reply of the WAL routine is error handling. But this possibly can be implemented in a more efficient way.