Use a local DB channel for sending to the message-queue

The provided message-queue queue functions runs unti it succeeds. This means
sending to the message-queue will no longer potentially block for arbitrary
amount of times as sending messages is just writing them to a DB.
This commit is contained in:
Luke Parker
2024-09-11 19:29:56 -04:00
parent b6811f9015
commit 0d4c8cf032
4 changed files with 96 additions and 84 deletions

View File

@@ -1,21 +1,4 @@
use ciphersuite::group::GroupEncoding;
use serai_client::validator_sets::primitives::Session;
use serai_db::{Get, DbTxn, create_db, db_channel};
use primitives::EncodableG;
create_db! {
Processor {
ExternalKeyForSessionForSigners: <K: GroupEncoding>(session: Session) -> EncodableG<K>,
}
}
db_channel! {
Processor {
KeyToActivate: <K: GroupEncoding>() -> EncodableG<K>
}
}
use serai_db::{Get, DbTxn, create_db};
create_db! {
BitcoinProcessor {

View File

@@ -57,8 +57,7 @@ async fn main() {
tokio::spawn(TxIndexTask(feed.clone()).continually_run(index_task, vec![]));
core::mem::forget(index_handle);
bin::coordinator_loop::<_, KeyGenParams, Scheduler<_>, Rpc<bin::Db>>(db, feed.clone(), feed)
.await;
bin::main_loop::<_, KeyGenParams, Scheduler<_>, Rpc<bin::Db>>(db, feed.clone(), feed).await;
}
/*