From 20a708339c08281f84613a6799043513b49fc2f1 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Thu, 28 Mar 2024 12:35:26 +1300 Subject: [PATCH] Raise `Stop` directly in `#defer_stop`. (#311) --- lib/async/task.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/async/task.rb b/lib/async/task.rb index 3db30a31..97a6f00d 100644 --- a/lib/async/task.rb +++ b/lib/async/task.rb @@ -275,7 +275,7 @@ def defer_stop # If we were asked to stop, we should do so now: if @defer_stop @defer_stop = nil - self.stop + raise Stop, "Stopping current task (was deferred)!" end end else