Unverified Commit 2ba8bdb1 authored by Ryan McCormick's avatar Ryan McCormick Committed by GitHub
Browse files

fix: Remove flaky doctest (#3560)

parent 2d0dab74
......@@ -492,27 +492,8 @@ impl<T> TaskHandle<T> {
///
/// This token is a child of the tracker's cancellation token and can be used
/// to cancel just this individual task without affecting other tasks.
///
/// # Example
/// ```rust
/// # use dynamo_runtime::utils::tasks::tracker::*;
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// # let tracker = TaskTracker::new(UnlimitedScheduler::new(), LogOnlyPolicy::new())?;
/// let handle = tracker.spawn(async {
/// tokio::time::sleep(std::time::Duration::from_secs(10)).await;
/// Ok("completed")
/// });
///
/// // Cancel this specific task
/// handle.cancellation_token().cancel();
///
/// // Task will be cancelled
/// let result = handle.await?;
/// assert!(result.is_err());
/// # Ok(())
/// # }
/// ```
// FIXME: The doctest previously here failed intermittently and may
// indicate a bug in either the doctest example or the implementation.
pub fn cancellation_token(&self) -> &CancellationToken {
&self.cancel_token
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment