use std::sync::Arc;
use super::super::SupervisorCore;
use crate::identity::TaskId;
impl SupervisorCore {
pub(in crate::core) async fn list_tasks(&self) -> Vec<(TaskId, Arc<str>)> {
self.registry.list().await
}
pub(in crate::core) async fn snapshot(&self) -> Vec<Arc<str>> {
self.registry.alive_snapshot().await
}
pub(in crate::core) async fn is_alive(&self, label: &str) -> bool {
self.registry.is_alive(label).await
}
#[cfg(test)]
pub(in crate::core::runtime) async fn contains_id(&self, id: TaskId) -> bool {
self.registry.contains(id).await
}
#[cfg(all(test, feature = "controller"))]
pub(crate) fn registry_command_capacity(&self) -> usize {
self.cmd_tx.capacity()
}
#[cfg(test)]
pub(crate) async fn id_for_label(&self, label: &str) -> Option<TaskId> {
self.registry.id_for_label(label).await
}
}