Queue
public final class Queue : OperationQueue
Use this class to create custom queues.
-
The default queue of TermiNetwork used in all Request objects.
Declaration
Swift
public static var shared: Queue
-
A closure to be executed before the queue starts executing its requests.
Declaration
Swift
public var beforeAllRequestsCallback: BeforeQueueStartCallbackType?
-
A closure to be executed after the queue finishes the execution of all its requests.
Declaration
Swift
public var afterAllRequestsCallback: AfterAllRequestsCallbackType?
-
A closure to be executed before a request execution in queue.
Declaration
Swift
public var beforeEachRequestCallback: BeforeEachRequestCallbackType?
-
A closure to be executed after a request finishes its execution in queue.
Declaration
Swift
public var afterEachRequestCallback: AfterEachRequestCallbackType?
-
Initializes a new queue.
Declaration
Swift
public init(failureMode: QueueFailureMode = .continue)
Parameters
failureMode
Supported values are .continue (continues the execution of queue even if a request fails, this is the default) and .cancelAll (cancels all the remaining requests in queue)
-
Adds a Request instance into queue.
Declaration
Swift
override public func addOperation(_ operation: Foundation.Operation)
Parameters
failureMode
Supported values are .continue (continues the execution of queue even if a request fails, this is the default) and .cancelAll (cancels all the remaining requests in queue)