Originally there was single static URLSession.shared object to be used across all DeployItems. This changed with the need to use delegates for the authentication challenges.
Currently every DeployItem object uses its own URLSession to download its file. It might be prudent to revisit idea of dedicated "DownloadManager" class for downloading the DeployItems.
Reasons:
Apple recommends to share single URLSession object for multiple downloads.
All the static properties and functions for concurrency control could be moved to this class as instance properties.
It makes more sense for DownloadManager to implement URLSessionTaskDelegate and URLSessionDownloadDelegate protocols. For theDeployItem not so much.
Originally there was single static
URLSession.shared
object to be used across allDeployItems
. This changed with the need to use delegates for the authentication challenges.Currently every DeployItem object uses its own
URLSession
to download its file. It might be prudent to revisit idea of dedicated "DownloadManager" class for downloading theDeployItems
.Reasons:
URLSession
object for multiple downloads.URLSessionTaskDelegate
andURLSessionDownloadDelegate
protocols. For theDeployItem
not so much.