There’s task.cancel and coroutine.close. The latter is covered in a Luau Recap saying that it will mark a suspended coroutine as non-runnable and can be combined with defer to implement cancellation; the former is mentioned in a Release Note as “cancels a scheduled thread”.
Sounds like they aim for the same goal which is accept a thread to be cancelled. What, if any, is the difference between these two methods and where would I find it more appropriate to use one over the other or combine their use besides consistency and appearance?
task.cancel is meant to be used with coroutines managed by the Roblox task scheduler such as those created by task.spawn and task.delay and is guaranteed to interact properly with the task scheduler.
coroutine.close is meant to be used with coroutines that you’re managing yourself so it comes with the additional return value that you may need to implement whatever custom thing you’re building with coroutines.
There may be a lot of overlap between them in practice because the Roblox task scheduler is based on coroutines, but the context is different enough that it makes sense for them to be separate.
If you created a coroutine with task.spawn use task.cancel on it.
If you created a coroutine with coroutine.create use coroutine.close on it.