JobProcessor
public protocol JobProcessor: class
Defines an object which can process a QueueJob of a given type. A JobProcessor instance can be assigned to any JobQueue of the same underlying QueueJob type.
-
Processes a job of the given type. If the job fails to process for any reason the
Error
must be provided.Declaration
Parameters
job
The QueueJob to be processed
completion
The block to be called when the job has completed processing. The function must be called and should be provided the original
job
that was provided to the processor. If the JobProcessor fails to process thejob
, then the JobProcessor must provide anError
to the receiver.