RircdState::run()
This commit is contained in:
parent
21f4282cca
commit
e6e4a3df79
|
@ -34,7 +34,8 @@ impl RircdState {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn run(mut self) -> Result<()> {
|
pub async fn run(mut self) -> Result<()> {
|
||||||
for endpoint in self.endpoints {
|
//try to start each endpoint
|
||||||
|
self.endpoints.iter().filter(|ep| ep.is_active()).for_each(|endpoint| {
|
||||||
let endpoint_name = endpoint.name();
|
let endpoint_name = endpoint.name();
|
||||||
let (success_status_send,success_status_recv) = oneshot::channel::<Result<()>>();
|
let (success_status_send,success_status_recv) = oneshot::channel::<Result<()>>();
|
||||||
tokio::spawn(endpoint.listen(success_status_send));
|
tokio::spawn(endpoint.listen(success_status_send));
|
||||||
|
@ -44,7 +45,7 @@ impl RircdState {
|
||||||
Ok(_) => format!("SUCCEEDED |"),
|
Ok(_) => format!("SUCCEEDED |"),
|
||||||
Err(e) => format!("FAILED| <{}>", e),
|
Err(e) => format!("FAILED| <{}>", e),
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue