Classes

The following classes are available globally.

  • Will retry the job every N seconds, scaling at a power of 2, until a max number of seconds is reached, at which point the queue will try to re-process the job at that max time interval.

    MaxRetryStrategy is appropriate for situations wherein failure may decrease over time. A good example would be a Processor which is attempting to upload data to a server, but the server is down. We don’t want to continuously ping the server, rather we want to gradually back off more and more over time until the server is back online.

    See more

    Declaration

    Swift

    open class BackoffRetryStrategy: JobRetryStrategy
  • A retry strategy that doesn’t actually retry anything. Rather, this strategy will simply stop the queue, halting all further progress, queue the job for immediate processing when the queue is started again.

    See more

    Declaration

    Swift

    open class HaltRetryStrategy: JobRetryStrategy
  • A type-erased wrapper for a JobProcessor. Use this if you need to define an argument of a JobProcessor, or if you need to store a JobProcessor as a property.

    Examples:

    struct MyJobType: QueueJob { ... }
    var persister: AnyJobProcessor<MyJobType>
    func someFunc(usingProcessor: AnyJobPersister<MyJobType>)
    
    See more

    Declaration

    Swift

    open class AnyJobProcessor<HandlingJob: QueueJob>: JobProcessor
  • An in-memory (with optional persistence) queue which can be processed by a JobProcessor

    See more

    Declaration

    Swift

    open class JobQueue<Job: QueueJob>
  • Will immediately retry the failed job until the maximum number of failure for that job is reached. Defaults to a max of 5 retries

    See more

    Declaration

    Swift

    open class MaxRetryStrategy: JobRetryStrategy
  • 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>)
    
    See more

    Declaration

    Swift

    public class AnyJobPersister<HandlingJob: QueueJob>: JobPersister
  • A token to be strongly retained by any observers of a JobQueue JobQueueNotificationTokens are created whenever an observer subscribes to a JobQueue

    Declaration

    Swift

    public class JobQueueNotificationToken<Job: QueueJob>