Closed ghost closed 2 years ago
This behavior was introduced in an older version of Janitor, and in my opinion it masks the true behaviour of cleanups. Cleanup operations should be non-yielding, it doesn't really make sense to have a cleanup operation that takes time. Handling the threading yourself, rather than Janitor doing it for you makes a lot more sense to me. This is especially true now that it's quite primitive to do tasks in Luau,
janitor:Add(function()
task.spawn(function()
-- some yielding operation
end)
end)
I agree, I just realized this was a minor design flow within how I control my cleanup tasks.
Currently, my janitor functions yield like so:
This causes other cleanup methods to be delayed of course which isn't expected behavior, and I and (mostly no-one) wants to go through the headache of handling these yielding operations in a new thread just because of how Janitor works.