Inherits from NSObject
Declared in RACScheduler.h

Overview

Schedulers are used to control when and where work is performed. Note that RACSchedulers are expected to be serial. Subclasses must honor that contract. See RACTargetQueueScheduler for a queue-based scheduler which will enforce the serialization guarantee.

Tasks

Other Methods

Extension Methods

Deprecated Methods

Class Methods

currentScheduler

+ (RACScheduler *)currentScheduler
Discussion

The current scheduler. This will only be valid when used from within a [RACScheduler schedule:] block or when on the main thread.

Declared In

RACScheduler.h

immediateScheduler

+ (RACScheduler *)immediateScheduler
Discussion

Note: Unlike most other schedulers, this does not set the current scheduler. There may still be a valid currentScheduler if this is used within a block scheduled on a different scheduler.

Declared In

RACScheduler.h

mainThreadScheduler

+ (RACScheduler *)mainThreadScheduler
Discussion

A singleton scheduler that executes blocks in the main thread.

Declared In

RACScheduler.h

scheduler

+ (RACScheduler *)scheduler
Discussion

Invokes schedulerWithPriority: with RACSchedulerPriorityDefault.

Declared In

RACScheduler.h

schedulerWithPriority:

+ (RACScheduler *)schedulerWithPriority:(RACSchedulerPriority)priority
Discussion

Invokes schedulerWithPriority:name: with a default name.

Declared In

RACScheduler.h

schedulerWithPriority:name:

+ (RACScheduler *)schedulerWithPriority:(RACSchedulerPriority)priority name:(NSString *)name
Discussion

Scheduler creation is cheap. It’s unnecessary to save the result of this method call unless you want to serialize some actions on the same background scheduler.

Declared In

RACScheduler.h

schedulerWithQueue:name:

+ (RACScheduler *)schedulerWithQueue:(dispatch_queue_t)queue name:(NSString *)name

Instance Methods

after:repeatingEvery:withLeeway:schedule:

- (RACDisposable *)after:(NSDate *)date repeatingEvery:(NSTimeInterval)interval withLeeway:(NSTimeInterval)leeway schedule:(void ( ^ ) ( void ))block
Discussion

Returns a disposable which can be used to cancel the automatic scheduling and rescheduling, or nil if cancellation is not supported.

Declared In

RACScheduler.h

after:schedule:

- (RACDisposable *)after:(NSDate *)date schedule:(void ( ^ ) ( void ))block
Discussion

Returns a disposable which can be used to cancel the scheduled block before it begins executing, or nil if cancellation is not supported.

Declared In

RACScheduler.h

afterDelay:schedule:

- (RACDisposable *)afterDelay:(NSTimeInterval)delay schedule:(void ( ^ ) ( void ))block
Discussion

Converts the delay into an NSDate, then invokes after:schedule:.

Declared In

RACScheduler.h

performAsCurrentScheduler:

- (void)performAsCurrentScheduler:(void ( ^ ) ( void ))block
Discussion

block - The block to execute. Cannot be NULL.

Declared In

RACScheduler+Subclass.h

schedule:

- (RACDisposable *)schedule:(void ( ^ ) ( void ))block
Discussion

Returns a disposable which can be used to cancel the scheduled block before it begins executing, or nil if cancellation is not supported.

Declared In

RACScheduler.h

scheduleRecursiveBlock:

- (RACDisposable *)scheduleRecursiveBlock:(RACSchedulerRecursiveBlock)recursiveBlock
Discussion

Returns a disposable which can be used to cancel the scheduled block before it begins executing, or to stop it from rescheduling if it’s already begun execution.

Declared In

RACScheduler.h