mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
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:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user