Classes
The following classes are available globally.
-
An AsyncSubject emits the last value (and only the last value) emitted by the source Observable, and only after that source Observable completes.
(If the source Observable does not emit any values, the AsyncSubject also completes without emitting any values.)
See moreDeclaration
Swift
public final class AsyncSubject<Element> : Observable<Element> , SubjectType , ObserverType , SynchronizedUnsubscribeType
-
Represents a value that changes over time.
Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
See moreDeclaration
Swift
public final class BehaviorSubject<Element> : Observable<Element> , SubjectType , ObserverType , SynchronizedUnsubscribeType , Cancelable
-
Represents a disposable resource that can be checked for disposal status.
See moreDeclaration
Swift
public final class BooleanDisposable : Cancelable
-
Represents a group of disposable resources that are disposed together.
See moreDeclaration
Swift
public final class CompositeDisposable : DisposeBase, Cancelable
-
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.
See moreDeclaration
Swift
public class ConcurrentDispatchQueueScheduler : SchedulerType
-
Abstracts work that needs to be performed on
MainThread
. In caseschedule
methods are called from main thread, it will perform action immediately without scheduling.This scheduler is optimized for
See moresubscribeOn
operator. If you want to observe observable sequence elements on main thread usingobserveOn
operator,MainScheduler
is more suitable for that purpose.Declaration
Swift
public final class ConcurrentMainScheduler : SchedulerType
-
Represents an object that schedules units of work on the current thread.
This is the default scheduler for operators that generate elements.
This scheduler is also sometimes called
See moretrampoline scheduler
.Declaration
Swift
public class CurrentThreadScheduler : ImmediateSchedulerType
-
Thread safe bag that disposes added disposables on
deinit
.This returns ARC (RAII) like resource management to
RxSwift
.In case contained disposables need to be disposed, just put a different dispose bag or create a new one in its place.
self.existingDisposeBag = DisposeBag()
In case explicit disposal is necessary, there is also
See moreCompositeDisposable
.Declaration
Swift
public final class DisposeBag : DisposeBase
-
Base class for all disposables.
Declaration
Swift
public class DisposeBase
-
Provides a virtual time scheduler that uses
See moreDate
for absolute time andNSTimeInterval
for relative time.Declaration
Swift
public class HistoricalScheduler : VirtualTimeScheduler<HistoricalSchedulerTimeConverter>
-
Abstracts work that needs to be performed on
DispatchQueue.main
. In caseschedule
methods are called fromDispatchQueue.main
, it will perform action immediately without scheduling.This scheduler is usually used to perform UI work.
Main scheduler is a specialization of
SerialDispatchQueueScheduler
.This scheduler is optimized for
See moreobserveOn
operator. To ensure observable sequence is subscribed on main thread usingsubscribeOn
operator please useConcurrentMainScheduler
because it is more optimized for that purpose.Declaration
Swift
public final class MainScheduler : SerialDispatchQueueScheduler
-
Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence.
See moreDeclaration
Swift
public class ConnectableObservable<Element> : Observable<Element> , ConnectableObservableType
-
Declaration
Swift
public class Observable<Element> : ObservableType
-
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
See moremaxConcurrentOperationCount
.Declaration
Swift
public class OperationQueueScheduler : ImmediateSchedulerType
-
Represents an object that is both an observable sequence as well as an observer.
Each notification is broadcasted to all subscribed observers.
See moreDeclaration
Swift
public final class PublishSubject<Element> : Observable<Element> , SubjectType , Cancelable , ObserverType , SynchronizedUnsubscribeType
-
Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
See moreDeclaration
Swift
public final class RefCountDisposable : DisposeBase, Cancelable
-
Represents an object that is both an observable sequence as well as an observer.
Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
See moreDeclaration
Swift
public class ReplaySubject<Element> : Observable<Element> , SubjectType , ObserverType , Disposable
-
Represents a disposable resource whose disposal invocation will be scheduled on the specified scheduler.
See moreDeclaration
Swift
public final class ScheduledDisposable : Cancelable
-
Abstracts the work that needs to be performed on a specific
dispatch_queue_t
. It will make sure that even if concurrent dispatch queue is passed, it’s transformed into a serial one.It is extremely important that this scheduler is serial, because certain operator perform optimizations that rely on that property.
Because there is no way of detecting is passed dispatch queue serial or concurrent, for every queue that is being passed, worst case (concurrent) will be assumed, and internal serial proxy dispatch queue will be created.
This scheduler can also be used with internal serial queue alone.
In case some customization need to be made on it before usage, internal serial queue can be customized using
See moreserialQueueConfiguration
callback.Declaration
Swift
public class SerialDispatchQueueScheduler : SchedulerType
-
Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource.
See moreDeclaration
Swift
public final class SerialDisposable : DisposeBase, Cancelable
-
Represents a disposable resource which only allows a single assignment of its underlying disposable resource.
If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an exception.
See moreDeclaration
Swift
public final class SingleAssignmentDisposable : DisposeBase, Cancelable
-
Base class for virtual time schedulers using a priority queue for scheduled items.
See moreDeclaration
Swift
open class VirtualTimeScheduler<Converter: VirtualTimeConverterType> : SchedulerType
extension VirtualTimeScheduler: CustomDebugStringConvertible