Disposables

public enum Disposables

Contains factory methods for creating common Disposable instances for use with the Tealium SDK.

  • Creates a Disposable which calls the given unsubscribe block when the subscription is disposed.

    The returned implementation is not considered to be thread-safe, so interaction is expected to be constrained to an appropriate thread by the user.

    Declaration

    Swift

    static func subscription(unsubscribe: @escaping () -> Void = { }) -> Disposable

    Parameters

    unsubscribe

    Optional callback to execute when this Disposable is disposed.

    Return Value

    A Disposable to dispose of the subscription.

  • Creates a CompositeDisposable which can be used to store multiple Disposable instances for bulk disposal.

    Additional Disposable instances can be added via CompositeDisposable.add.

    The returned implementation is not considered to be thread-safe, so interaction is expected to be constrained to an appropriate thread by the user.

    Declaration

    Swift

    static func composite() -> CompositeDisposable

    Return Value

    A CompositeDisposable to dispose of multiple Disposable at once.

  • Creates a CompositeDisposable which can be used to store multiple Disposable instances for bulk disposal. All methods are executed using the given queue to ensure operation is thread-safe.

    Additional Disposable instances can be added via CompositeDisposable.add.

    Declaration

    Swift

    static func composite(queue: TealiumQueue) -> CompositeDisposable

    Parameters

    queue

    The TealiumQueue implementation to use for all operations of this Disposable.

    Return Value

    A CompositeDisposable to dispose of multiple Disposable at once, whilst ensuring that all operations happen on the given queue.

  • Creates a CompositeDisposable which can be used to store multiple Disposable instances for bulk disposal. This Disposable will automatically dispose upon deinitialization.

    Additional Disposable instances can be added via CompositeDisposable.add.

    The returned implementation is not considered to be thread-safe, so interaction is expected to be constrained to an appropriate thread by the user.

    Declaration

    Swift

    static func automaticComposite() -> CompositeDisposable

    Return Value

    A CompositeDisposable to dispose of multiple Disposable at once.

  • Returns a Disposable implementation that:

    Declaration

    Swift

    static func disposed() -> Disposable