diff --git a/src/subsystem/nested_subsystem.rs b/src/subsystem/nested_subsystem.rs index 6347ac9..cfc5378 100644 --- a/src/subsystem/nested_subsystem.rs +++ b/src/subsystem/nested_subsystem.rs @@ -19,7 +19,7 @@ impl NestedSubsystem { /// ``` /// use miette::Result; /// use tokio::time::{sleep, Duration}; - /// use tokio_graceful_shutdown::SubsystemHandle; + /// use tokio_graceful_shutdown::{ErrorAction, SubsystemBuilder, SubsystemHandle}; /// /// async fn nested_subsystem(subsys: SubsystemHandle) -> Result<()> { /// // This subsystem does nothing but wait for the shutdown to happen diff --git a/src/subsystem/subsystem_handle.rs b/src/subsystem/subsystem_handle.rs index 603e1a6..724d6ef 100644 --- a/src/subsystem/subsystem_handle.rs +++ b/src/subsystem/subsystem_handle.rs @@ -57,7 +57,7 @@ impl SubsystemHandle { /// /// ``` /// use miette::Result; - /// use tokio_graceful_shutdown::SubsystemHandle; + /// use tokio_graceful_shutdown::{SubsystemBuilder, SubsystemHandle}; /// /// async fn nested_subsystem(subsys: SubsystemHandle) -> Result<()> { /// subsys.on_shutdown_requested().await; @@ -189,7 +189,7 @@ impl SubsystemHandle { /// return immediately. /// /// This is the primary method of subsystems to react to - /// the shutdown requests. Most often, it will be used in `tokio::select` + /// the shutdown requests. Most often, it will be used in [`tokio::select`] /// statements to cancel other code as soon as the shutdown is requested. /// /// # Examples @@ -201,22 +201,22 @@ impl SubsystemHandle { /// /// async fn countdown() { /// for i in (1..10).rev() { - /// log::info!("Countdown: {}", i); + /// tracing::info!("Countdown: {}", i); /// sleep(Duration::from_millis(1000)).await; /// } /// } /// /// async fn countdown_subsystem(subsys: SubsystemHandle) -> Result<()> { - /// log::info!("Starting countdown ..."); + /// tracing::info!("Starting countdown ..."); /// /// // This cancels the countdown as soon as shutdown /// // mode was entered /// tokio::select! { /// _ = subsys.on_shutdown_requested() => { - /// log::info!("Countdown cancelled."); + /// tracing::info!("Countdown cancelled."); /// }, /// _ = countdown() => { - /// log::info!("Countdown finished."); + /// tracing::info!("Countdown finished."); /// } /// }; /// @@ -246,17 +246,17 @@ impl SubsystemHandle { /// tokio::select! { /// // Execute an action. A dummy `sleep` in this case. /// _ = sleep(Duration::from_millis(1000)) => { - /// log::info!("Action finished."); + /// tracing::info!("Action finished."); /// } /// // Perform a shutdown if requested /// _ = subsys.on_shutdown_requested() => { - /// log::info!("Action aborted."); + /// tracing::info!("Action aborted."); /// }, /// } /// } /// /// async fn my_subsystem(subsys: SubsystemHandle) -> Result<()> { - /// log::info!("Starting subsystem ..."); + /// tracing::info!("Starting subsystem ..."); /// /// // We cannot do a `tokio::select` with `on_shutdown_requested` /// // here, because a shutdown would cancel the action without giving @@ -265,7 +265,7 @@ impl SubsystemHandle { /// uncancellable_action(&subsys).await; /// } /// - /// log::info!("Subsystem stopped."); + /// tracing::info!("Subsystem stopped."); /// /// Ok(()) /// }