diff --git a/src/lib.rs b/src/lib.rs index 985023c..3a745be 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -113,6 +113,7 @@ mod into_subsystem; mod runner; mod signal_handling; mod subsystem; +mod tokio_task; mod toplevel; mod utils; @@ -124,6 +125,3 @@ pub use subsystem::SubsystemBuilder; pub use subsystem::SubsystemFinishedFuture; pub use subsystem::SubsystemHandle; pub use toplevel::Toplevel; - -mod tokio_unstable; -use tokio_unstable::spawn; diff --git a/src/runner.rs b/src/runner.rs index d5cff69..4811a1a 100644 --- a/src/runner.rs +++ b/src/runner.rs @@ -33,7 +33,7 @@ impl SubsystemRunner { Err: Into, { let future = async { run_subsystem(name, subsystem, subsystem_handle, guard).await }; - let aborthandle = crate::spawn(future, "subsystem_runner").abort_handle(); + let aborthandle = crate::tokio_task::spawn(future, "subsystem_runner").abort_handle(); SubsystemRunner { aborthandle } } } @@ -57,7 +57,7 @@ async fn run_subsystem( let mut redirected_subsystem_handle = subsystem_handle.delayed_clone(); let future = async { subsystem(subsystem_handle).await.map_err(|e| e.into()) }; - let join_handle = crate::spawn(future, &name); + let join_handle = crate::tokio_task::spawn(future, &name); // Abort on drop guard.on_cancel({ diff --git a/src/tokio_unstable.rs b/src/tokio_task.rs similarity index 100% rename from src/tokio_unstable.rs rename to src/tokio_task.rs diff --git a/src/toplevel.rs b/src/toplevel.rs index eae9c35..1c1c9d1 100644 --- a/src/toplevel.rs +++ b/src/toplevel.rs @@ -121,7 +121,7 @@ impl Toplevel { pub fn catch_signals(self) -> Self { let shutdown_token = self.root_handle.get_cancellation_token().clone(); - crate::spawn( + crate::tokio_task::spawn( async move { wait_for_signal().await; shutdown_token.cancel();