Skip to content

Commit

Permalink
Add documentation to Async::Task#stop to clarify stopped! transit…
Browse files Browse the repository at this point in the history
…ion.
  • Loading branch information
ioquatix committed Feb 24, 2024
1 parent a56bf9d commit 92319f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/async/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def wait
# @parameter later [Boolean] Whether to stop the task later, or immediately.
def stop(later = false)
if self.stopped?
# If we already stopped this task... don't try to stop it again:
# 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.
return stopped!
end

Expand Down

0 comments on commit 92319f8

Please sign in to comment.