Merge branch 'ptmgr-todos' into 'main'

Dispose of ptmgr TODOs (and remove a dead variable)

See merge request tpo/core/arti!912
This commit is contained in:
eta 2022-11-30 17:37:47 +00:00
commit e13f2cf7d9
1 changed files with 2 additions and 7 deletions

View File

@ -37,8 +37,6 @@
#![allow(clippy::result_large_err)] // temporary workaround for arti#587
//! <!-- @@ end lint list maintained by maint/add_warning @@ -->
#![allow(dead_code)] // FIXME TODO pt-client remove after implementing reactor.
pub mod config;
pub mod err;
pub mod ipc;
@ -296,8 +294,6 @@ pub struct PtMgr<R> {
state: Arc<RwLock<PtSharedState>>,
/// PtReactor channel.
tx: UnboundedSender<PtReactorMessage>,
/// Directory to store PT state in.
state_dir: PathBuf,
}
impl<R: Runtime> PtMgr<R> {
@ -319,7 +315,7 @@ impl<R: Runtime> PtMgr<R> {
}
/// Create a new PtMgr.
// TODO pt-client: maybe don't have the Vec directly exposed?
// TODO: maybe don't have the Vec directly exposed?
pub fn new(
transports: Vec<ManagedTransportConfig>,
state_dir: PathBuf,
@ -332,7 +328,7 @@ impl<R: Runtime> PtMgr<R> {
let state = Arc::new(RwLock::new(state));
let (tx, rx) = mpsc::unbounded();
let mut reactor = PtReactor::new(rt.clone(), state.clone(), rx, state_dir.clone());
let mut reactor = PtReactor::new(rt.clone(), state.clone(), rx, state_dir);
rt.spawn(async move {
loop {
match reactor.run_one_step().await {
@ -351,7 +347,6 @@ impl<R: Runtime> PtMgr<R> {
runtime: rt,
state,
tx,
state_dir,
})
}