From c6543ed52feba15ac87ae7c19e3adcc25cb91dac Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 29 Jan 2021 20:36:29 +0000 Subject: [PATCH] remove printlns --- actix-rt/src/system.rs | 18 ------------------ actix-rt/src/worker.rs | 15 --------------- actix-rt/tests/tests.rs | 6 ------ 3 files changed, 39 deletions(-) diff --git a/actix-rt/src/system.rs b/actix-rt/src/system.rs index 8a4cb365..7a39e877 100644 --- a/actix-rt/src/system.rs +++ b/actix-rt/src/system.rs @@ -29,11 +29,6 @@ pub struct System { worker_handle: WorkerHandle, } -impl Drop for System { - fn drop(&mut self) { - eprintln!("dropping System") - } -} impl System { /// Create a new system. @@ -42,7 +37,6 @@ impl System { /// Panics if underlying Tokio runtime can not be created. #[allow(clippy::new_ret_no_self)] pub fn new() -> SystemRunner { - eprintln!("System::new"); Self::create_runtime(async {}) } @@ -77,21 +71,16 @@ impl System { let (stop_tx, stop_rx) = oneshot::channel(); let (sys_tx, sys_rx) = mpsc::unbounded_channel(); - eprintln!("creating runtime"); let rt = Runtime::new().expect("Actix (Tokio) runtime could not be created."); - eprintln!("creating worker and system"); let system = System::construct(sys_tx, Worker::new_current_thread(rt.local_set())); - eprintln!("creating system controller"); // init background system worker let sys_worker = SystemController::new(sys_rx, stop_tx); rt.spawn(sys_worker); - eprintln!("running init future"); // run system init future rt.block_on(init_fut); - eprintln!("done; here's your system runner"); SystemRunner { rt, stop_rx, @@ -104,7 +93,6 @@ impl System { /// # Panics /// Panics if no system is registered on the current thread. pub fn current() -> System { - eprintln!("gib current system"); CURRENT.with(|cell| match *cell.borrow() { Some(ref sys) => sys.clone(), None => panic!("System is not running"), @@ -163,7 +151,6 @@ pub struct SystemRunner { impl SystemRunner { /// Starts event loop and will return once [System] is [stopped](System::stop). pub fn run(self) -> io::Result<()> { - eprintln!("SystemRunner: run"); let SystemRunner { rt, stop_rx, .. } = self; @@ -219,11 +206,6 @@ impl SystemController { } } } -impl Drop for SystemController { - fn drop(&mut self) { - eprintln!("dropping SystemController") - } -} impl Future for SystemController { type Output = (); diff --git a/actix-rt/src/worker.rs b/actix-rt/src/worker.rs index b1f4a713..40e3c3a1 100644 --- a/actix-rt/src/worker.rs +++ b/actix-rt/src/worker.rs @@ -45,15 +45,9 @@ pub struct WorkerHandle { sender: mpsc::UnboundedSender, } -impl Drop for WorkerHandle { - fn drop(&mut self) { - eprintln!("dropping WorkerHandle") - } -} impl WorkerHandle { pub(crate) fn new(sender: mpsc::UnboundedSender) -> Self { - eprintln!("WorkerHandle::new"); Self { sender } } @@ -272,21 +266,14 @@ struct WorkerRunner { rx: mpsc::UnboundedReceiver, } -impl Drop for WorkerRunner { - fn drop(&mut self) { - eprintln!("dropping WorkerRunner") - } -} impl Future for WorkerRunner { type Output = (); fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - eprintln!("WorkerRunner: poll"); // process all items currently buffered in channel loop { - eprintln!("WorkerRunner: loop"); match ready!(Pin::new(&mut self.rx).poll_recv(cx)) { // channel closed; no more messages can be received @@ -295,11 +282,9 @@ impl Future for WorkerRunner { // process worker command Some(item) => match item { WorkerCommand::Stop => { - eprintln!("WorkerRunner: stopping"); return Poll::Ready(()); } WorkerCommand::Execute(task_fut) => { - eprintln!("WorkerRunner: executing task"); tokio::task::spawn_local(task_fut); } }, diff --git a/actix-rt/tests/tests.rs b/actix-rt/tests/tests.rs index 76b25715..7cd6619e 100644 --- a/actix-rt/tests/tests.rs +++ b/actix-rt/tests/tests.rs @@ -192,10 +192,7 @@ fn no_system_worker_new_panic() { fn system_worker_spawn() { let runner = System::new(); - eprintln!("making channel"); let (tx, rx) = oneshot::channel(); - - eprintln!("getting initial system worker"); let sys = System::current(); thread::spawn(|| { @@ -212,10 +209,7 @@ fn system_worker_spawn() { let wrk = sys.worker(); wrk.spawn(async move { - eprintln!("before send"); tx.send(42u32).unwrap(); - - eprintln!("after send"); System::current().stop(); }); });