remove new indirection

This commit is contained in:
Rob Ede 2021-01-31 03:18:57 +00:00
parent 13bc72a71e
commit f10a4e739e
No known key found for this signature in database
GPG Key ID: C2A3B36E841A91E6
2 changed files with 2 additions and 6 deletions

View File

@ -147,7 +147,7 @@ impl Arbiter {
}
/// Sets up an Arbiter runner on the current thread using the provided runtime local task set.
pub(crate) fn new_current_thread(local: &LocalSet) -> ArbiterHandle {
pub(crate) fn in_new_system(local: &LocalSet) -> ArbiterHandle {
let (tx, rx) = mpsc::unbounded_channel();
let hnd = ArbiterHandle::new(tx);

View File

@ -36,15 +36,11 @@ impl System {
/// Panics if underlying Tokio runtime can not be created.
#[allow(clippy::new_ret_no_self)]
pub fn new() -> SystemRunner {
Self::create_runtime()
}
fn create_runtime() -> SystemRunner {
let (stop_tx, stop_rx) = oneshot::channel();
let (sys_tx, sys_rx) = mpsc::unbounded_channel();
let rt = Runtime::new().expect("Actix (Tokio) runtime could not be created.");
let system = System::construct(sys_tx, Arbiter::new_current_thread(rt.local_set()));
let system = System::construct(sys_tx, Arbiter::in_new_system(rt.local_set()));
// init background system arbiter
let sys_ctrl = SystemController::new(sys_rx, stop_tx);