TNQueue
public final class TNQueue : OperationQueue
Use this class to create custom queues.
-
The default queue of TermiNetwork used in all TNRequest objects.
Declaration
Swift
public static var shared: TNQueue
-
A closure to be executed before the queue starts executing its requests.
Declaration
Swift
public var beforeAllRequestsCallback: TNBeforeQueueStartCallbackType?
-
A closure to be executed after the queue finishes the execution of all its requests.
Declaration
Swift
public var afterAllRequestsCallback: TNAfterAllRequestsCallbackType?
-
A closure to be executed before a request execution in queue.
Declaration
Swift
public var beforeEachRequestCallback: TNBeforeEachRequestCallbackType?
-
A closure to be executed after a request finishes its execution in queue.
Declaration
Swift
public var afterEachRequestCallback: TNAfterEachRequestCallbackType?
-
Initializes a new queue.
Declaration
Swift
public init(failureMode: TNQueueFailureMode = .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 TNRequest instance into queue.
Declaration
Swift
override public func addOperation(_ operation: 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)