2024-09-24 19:07 UTC
@bigzaphod true. my guess is that .task is just for short-ish things that are heavily tied to the view.
the docs state that the task is cancelled as soon as the view is removed or changes identity.
for longer running operations or things that need to keep running even if the particular view is gone, you would need to handle that in your model layer anyway and/or with the .backgroundTask modifier on Scene.
Replies (1)
-
@ffried@mastodon.social 2024-09-24 19:15
@vpsteinmann@mastodon.social @bigzaphod@mastodon.social I think the short tasks are only one part of the reason for the task modifier. One big advantage of its behavior is using it for iterating long running (or even endless) async sequences. Like observing changes.