Back to Rxswift

OperationQueueScheduler

docs/Classes/OperationQueueScheduler.html

6.10.22.0 KB
Original Source

OperationQueueScheduler

public class OperationQueueScheduler : ImmediateSchedulerType

Abstracts the work that needs to be performed on a specific NSOperationQueue.

This scheduler is suitable for cases when there is some bigger chunk of work that needs to be performed in background and you want to fine tune concurrent processing using maxConcurrentOperationCount.

`

                operationQueue
                `

Undocumented

Declaration

Swift

public let operationQueue: OperationQueue

`

                queuePriority
                `

Undocumented

Declaration

Swift

public let queuePriority: Operation.QueuePriority

`

                init(operationQueue:queuePriority:)
                `

Constructs new instance of OperationQueueScheduler that performs work on operationQueue.

Declaration

Swift

public init(operationQueue: OperationQueue, queuePriority: Operation.QueuePriority = .normal)

Parameters

| operationQueue |

Operation queue targeted to perform work on.

| | queuePriority |

Queue priority which will be assigned to new operations.

|

`

                schedule(_:action:)
                `

Schedules an action to be executed recursively.

Declaration

Swift

public func schedule<StateType>(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable

Parameters

| state |

State passed to the action to be executed.

| | action |

Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.

|

Return Value

The disposable object used to cancel the scheduled action (best effort).