Transformer

public protocol Transformer : Module

An object that will apply different transformations, selected by transformationId, to a dispatch.

  • Applies the specified transformation to a Dispatch for the DispatchScope in which this transformation is called.

    • Threading: This method is called on the Tealium queue, and the caller disposes the returned Disposable on the Tealium queue. completion must be called on the Tealium queue (see queue); it may be called synchronously, before this method returns.
    • Completion: Call completion exactly once, unless the caller has disposed the returned Disposable. Pass the transformed or unchanged dispatch for it to proceed, or nil to drop it and stop any further processing.
    • Cancellation: The caller may dispose the returned Disposable to cancel the transformation. After that, calling completion is not required, and the caller ignores any call. Disposing after completion has been called must have no effect. Implementations with nothing to cancel, including synchronous ones, return Disposables.disposed().

    Declaration

    Swift

    @discardableResult
    func applyTransformation(_ transformation: TransformationSettings,
                             to dispatch: Dispatch,
                             scope: DispatchScope,
                             completion: @escaping (Dispatch?) -> Void) -> any Disposable

    Return Value

    A Disposable that cancels in-progress work, or Disposables.disposed() if there is nothing to cancel.

Available where Self: BasicModule

  • factory Extension method

    Returns a BasicModuleFactory for this transformer, used by automatic-loader classes to register the transformer as a default module. Not intended for direct use.

    Declaration

    Swift

    static var factory: BasicModuleFactory<Self> { get }