arcgis-maps-sdk-swift-samples icon indicating copy to clipboard operation
arcgis-maps-sdk-swift-samples copied to clipboard

Examine excessive use of `Task` blocks in UI

Open yo1995 opened this issue 1 year ago • 0 comments

https://forums.swift.org/t/task-syntax-sugar/68876 and see the related discussion on Slack.

While it is sometimes OK to wrap an async code block in a Task, it is always recommended to use structured concurrency when possible so the scope of the async task is managed.

Go through the code base and examine the unstructured Task blocks with these criteria:

  • Will multiple UI state changes/UI invocations cause execution order problem or race condition?
  • Will repetitively calling the block consume too much resource?
  • Does the task need to be cancelled?

There aren't too many occurrences of unstructured task due to our efforts like in #153 but we shall still revisit them to ensure we are doing the right things.

yo1995 avatar Dec 13 '23 00:12 yo1995