ConcurrentDispatchQueueScheduler

public class ConcurrentDispatchQueueScheduler: SchedulerType

Abstracts the work that needs to be performed on a specific dispatch_queue_t. You can also pass a serial dispatch queue, it shouldn’t cause any problems.

This scheduler is suitable when some work needs to be performed in background.

  • now

    Undocumented

    Declaration

    Swift

    public class ConcurrentDispatchQueueScheduler: SchedulerType
  • Constructs new ConcurrentDispatchQueueScheduler that wraps queue.

    Declaration

    Swift

    public init(queue: dispatch_queue_t)

    Parameters

    queue

    Target dispatch queue.

  • Convenience init for scheduler that wraps one of the global concurrent dispatch queues.

    Declaration

    Swift

    public convenience init(globalConcurrentQueueQOS: DispatchQueueSchedulerQOS)

    Parameters

    globalConcurrentQueueQOS

    Target global dispatch queue, by quality of service class.

  • Schedules an action to be executed immediatelly.

    Declaration

    Swift

    public final func schedule<StateType>(state: StateType, action: StateType -> Disposable) -> Disposable

    Parameters

    state

    State passed to the action to be executed.

    action

    Action to be executed.

    Return Value

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

  • Schedules an action to be executed.

    Declaration

    Swift

    public final func scheduleRelative<StateType>(state: StateType, dueTime: NSTimeInterval, action: (StateType) -> Disposable) -> Disposable

    Parameters

    state

    State passed to the action to be executed.

    dueTime

    Relative time after which to execute the action.

    action

    Action to be executed.

    Return Value

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

  • Schedules a periodic piece of work.

    Declaration

    Swift

    public func schedulePeriodic<StateType>(state: StateType, startAfter: TimeInterval, period: TimeInterval, action: (StateType) -> StateType) -> Disposable

    Parameters

    state

    State passed to the action to be executed.

    startAfter

    Period after which initial work should be run.

    period

    Period for running the work periodically.

    action

    Action to be executed.

    Return Value

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