public struct DownloadTask
Represents a task of an image downloading process.
SessionDataTaskobject bounded to this download task. Multiple
DownloadTasks could refer to a same
sessionTask. This is an optimization in Kingfisher to prevent multiple downloading task for the same URL resource at the same time.
SessionDataTaskand its cancel token will be pass through. You can use them to identify the cancelled task.
public let sessionTask: SessionDataTask
Cancel this task if it is running. It will do nothing if this task is not running.
NoteIn Kingfisher, there is an optimization to prevent starting another download task if the target URL is being downloading. However, even when internally no new session task created, a
DownloadTaskwill be still created and returned when you call related methods, but it will share the session downloading task with a previous task. In this case, if multiple
DownloadTasks share a single session download task, cancelling a
DownloadTaskdoes not affect other
public func cancel()