feat(drainer): added drainer which reads from redis stream and executes queries on DB (#142)

This commit is contained in:
Abhishek
2022-12-16 15:38:03 +05:30
committed by GitHub
parent 3db49d0530
commit 3bad58b0d3
41 changed files with 648 additions and 655 deletions

View File

@ -0,0 +1,20 @@
use drainer::{errors::DrainerResult, start_drainer};
use router::configs::settings;
use structopt::StructOpt;
#[tokio::main]
async fn main() -> DrainerResult<()> {
// Get configuration
let cmd_line = settings::CmdLineConf::from_args();
let conf = settings::Settings::with_config_path(cmd_line.config_path).unwrap();
let store = router::services::Store::new(&conf, false).await;
let store = std::sync::Arc::new(store);
let number_of_drainers = conf.drainer.num_partitions;
let max_read_count = conf.drainer.max_read_count;
start_drainer(store, number_of_drainers, max_read_count).await?;
Ok(())
}