AnyJobPersister
public class AnyJobPersister<HandlingJob: QueueJob>: JobPersister
                A type-erased wrapper for a JobPersister. Use this if you need to define an argument of a JobPersister, or if you need to store a JobPersister as a property.
Examples:
struct MyJobType: QueueJob { ... }
var persister: AnyJobPersister<MyJobType>
func someFunc(takingPersister: AnyJobPersister<MyJobType>)
          - 
                  
                  
The expected QueueJob type this erasure is wrapping
Declaration
Swift
public typealias JobType = HandlingJob - 
                  
                  
Creates a new wrapper for the given
JobPersisterDeclaration
Swift
public init<P: JobPersister>(_ persister: P) where P.JobType == HandlingJob - 
                  
                  
Will save the jobs to a permanent destination using the internal
JobPersisterThrows
If there’s an error persisting 1 or more of the jobs.Declaration
Swift
public func persist(_ jobs: [HandlingJob]) throwsParameters
jobsThe jobs to persist
 - 
                  
                  
Deletes the job’s persisted data using the internal
JobPersisterThrows
If there’s an error deleting the job’s persisted data.Declaration
Swift
public func delete(_ job: HandlingJob) throwsParameters
jobThe job whose data is to be deleted
 - 
                  
                  
Loads all the Jobs from their permanent source using the internal
JobPersisterThrows
If there’s an error loading and deserializing 1 or more jobs from their persisted data.Declaration
Swift
public func load() throws -> [HandlingJob]Return Value
An array of deserialized jobs.
 - 
                  
                  
Deletes all jobs from the persisted location using the internal
JobPersisterDeclaration
Swift
public func clear(completion: ((Error?) -> Void)?)Parameters
completionAn optional callback to be called after the clearing has completed.
 
View on GitHub
        AnyJobPersister Class Reference