DownloadQueue
class DownloadQueue : OperationQueue
OperationQueue class, which is responsible for managing all download operations.
-
Progress.
Declaration
Swift
var downloadProgress: DownloadTaskProgress -
The
Operationobject that used to report the completion of all running operations.Declaration
Swift
var finishedOperation: Operation? -
List of tasks that failed.
Declaration
Swift
let failedTasks: SynchronizedArray<DMSwiftTypealias.Download.FailedTask> -
Informs successful start of operations.
Declaration
Swift
public var onStarted: (() -> Void)? -
Informs on changes in progress.
Declaration
Swift
public var onTaskProgressUpdate: ((_ progress: DownloadTaskProgress) -> Void)? -
Informs on when downloaded size or total files size changes.
Declaration
Swift
public var onDownloadProgressUpdate: ((_ progress: DownloadTaskProgress) -> Void)? -
Informs when one of files will be saved.
Declaration
Swift
public var onFileSaveComplete: ((_ fileData: DMSwiftTypealias.Download.SavedFileData?) -> Void)? -
Informs completion of all operations.
Declaration
Swift
public var onComplete: ((_ failledTasks: [DMSwiftTypealias.Download.FailedTask]) -> Void)? -
Initiates with required parameters.
Declaration
Swift
init(configuration: DMSwiftConfiguration, fileStorage: FileStorage)Parameters
configurationConfiguration to customize download process.
fileStorageFile storage manager for files manipulations.
-
Updates
Selfwith a new configuration.Declaration
Swift
func update(with downloaderConfiguration: DMSwiftConfiguration)Parameters
downloaderConfigurationA new configuration.
-
Updates
FileStorage.Declaration
Swift
func update(with fileStorage: FileStorage)Parameters
fileStoragea new
FileStorage -
Method used to start all operations in the queue or add new operation to the queue.
Declaration
Swift
func start(_ requests: [URLRequestTestable], completion: ((_ fileData: DMSwiftTypealias.Download.FileData) -> Void)? = nil)Parameters
requestsThe list of requests that are needed to create a list of download operations.
completionCompletion handler that will be called where time when a download task will be finished.
DownloadQueue Class Reference