PostProcessQueue
class PostProcessQueue : OperationQueue
OperationQueue class, which is responsible for managing all post-processing operations.
-
Whether the post-process will be in concurrency to download queue.
Declaration
Swift
var postProcessInConcurrencyToDownloadQueue: Bool
-
The
Operation
object 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.PostProcess.FailedTask>
-
Informs successful start of operations.
Declaration
Swift
public var onStarted: (() -> Void)?
-
Informs on changes in progress.
Declaration
Swift
public var onTaskProgressUpdate: ((_ progress: TaskProgress) -> Void)?
-
Informs completion of all operations.
Declaration
Swift
public var onComplete: ((_ failledTasks: [DMSwiftTypealias.PostProcess.FailedTask]) -> Void)?
-
Initiates with required parameters.
Declaration
Swift
init(configuration: DMSwiftConfiguration, fileStorage: FileStorage, postProcessings: [PostProcessing])
Parameters
configuration
DownloaderConfiguration
used to get preferred configuration.fileStorage
The file storage manager that used to pass to a
PostProcessing
object.postProcessings
Available post-processes.
-
Updates
Self
with theDMSwiftConfiguration
Declaration
Swift
func update(with dmSwiftConfiguration: DMSwiftConfiguration)
Parameters
dmSwiftConfiguration
Customizable configuration.
-
Updates postProcesses
Declaration
Swift
func update(postProcesses: [PostProcessing])
Parameters
postProcesses
List of all available post-preccesses.
-
Updates
FileStorage
.Declaration
Swift
func update(with fileStorage: FileStorage)
Parameters
fileStorage
a new
FileStorage
-
Method used to start all operations in Queue.
Please note, the dependent operation used for the purpose that a new operation could be added to the queue dynamically, taking into account that all operations in the queue can be completed before adding a new operation.
Declaration
Swift
func start(withDependentOperation dependentOperation: Operation?)
Parameters
dependentOperation
The operation that Queue will be dependent on before it finishes all operations.
-
Add post-process operation to queue.
Declaration
Swift
public func addPostProcessOperation(withFileData fileData: DMSwiftTypealias.Download.SavedFileData?) -> Operation?
Parameters
fileData
FileData
object that represents a file locationURL
, filename and file extension.