use crate::runtime::Workers;
use crate::runtime::dispatch::DispatcherClient;
#[derive(Debug, Clone)]
pub struct RuntimeControl {
dispatcher: DispatcherClient,
}
impl RuntimeControl {
pub(crate) const fn new(dispatcher: DispatcherClient) -> Self {
Self { dispatcher }
}
#[must_use]
pub fn workers(&self) -> &Workers {
self.dispatcher.workers()
}
#[cfg_attr(test, mutants::skip)] pub fn request_stop(&self) {
let cause = self.dispatcher.stop(arty_executor::ShutdownCause::default());
crate::runtime::worker::asynchronous::LocalWorker::begin_executor_shutdown(&self.dispatcher, cause);
}
}