Skip to content

Commit 92319f8

Browse files
committed
Add documentation to Async::Task#stop to clarify stopped! transition.
1 parent a56bf9d commit 92319f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/async/task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def wait
208208
# @parameter later [Boolean] Whether to stop the task later, or immediately.
209209
def stop(later = false)
210210
if self.stopped?
211-
# If we already stopped this task... don't try to stop it again:
211+
# If the task is already stopped, a `stop` state transition re-enters the same state which is a no-op. However, we will also attempt to stop any running children too. This can happen if the children did not stop correctly the first time around. Doing this should probably be considered a bug, but it's better to be safe than sorry.
212212
return stopped!
213213
end
214214

0 commit comments

Comments
 (0)