trying to avoid locking whole verification reporter

This commit is contained in:
2022-11-21 10:16:15 +01:00
parent d6ae213a6e
commit 43a1fb90ce
7 changed files with 142 additions and 41 deletions

View File

@ -13,9 +13,7 @@ use satrs_core::pus::event_man::{
DefaultPusMgmtBackendProvider, EventReporter, EventRequest, EventRequestWithToken,
PusEventDispatcher,
};
use satrs_core::pus::verification::{
MpscVerifSender, VerificationReporterCfg, VerificationReporterWithSender,
};
use satrs_core::pus::verification::{MpscVerifSender, VerificationReporterCfg, VerificationReporterWithSender};
use satrs_core::pus::{EcssTmError, EcssTmSender};
use satrs_core::tmtc::CcsdsError;
use satrs_example::{OBSW_SERVER_ADDR, SERVER_PORT};
@ -25,6 +23,7 @@ use std::net::{IpAddr, SocketAddr};
use std::sync::mpsc::channel;
use std::sync::{mpsc, Arc, Mutex, RwLock};
use std::thread;
use satrs_core::seq_count::SimpleSeqCountProvider;
struct TmFunnel {
tm_funnel_rx: mpsc::Receiver<StoreAddr>,
@ -73,9 +72,9 @@ fn main() {
let (tm_funnel_tx, tm_funnel_rx) = channel();
let (tm_server_tx, tm_server_rx) = channel();
let sender = MpscVerifSender::new(tm_store.clone(), tm_funnel_tx.clone());
let verif_cfg = VerificationReporterCfg::new(PUS_APID, 1, 2, 8).unwrap();
let verif_cfg = VerificationReporterCfg::new(PUS_APID, Box::new(SimpleSeqCountProvider::default()), 1, 2, 8).unwrap();
let reporter_with_sender_0 = Arc::new(Mutex::new(VerificationReporterWithSender::new(
verif_cfg,
&verif_cfg,
Box::new(sender),
)));