Transformer
public protocol Transformer : Module
An object that will apply different transformations, selected by transformationId, to a dispatch.
-
Applies the specified
transformationto aDispatchfor theDispatchScopein which this transformation is called.- Threading: This method is called on the Tealium queue, and the caller disposes the returned
Disposableon the Tealium queue.completionmust be called on the Tealium queue (seequeue); it may be called synchronously, before this method returns. - Completion: Call
completionexactly once, unless the caller has disposed the returnedDisposable. Pass the transformed or unchanged dispatch for it to proceed, ornilto drop it and stop any further processing. - Cancellation: The caller may dispose the returned
Disposableto cancel the transformation. After that, callingcompletionis not required, and the caller ignores any call. Disposing aftercompletionhas been called must have no effect. Implementations with nothing to cancel, including synchronous ones, returnDisposables.disposed().
Declaration
Swift
@discardableResult func applyTransformation(_ transformation: TransformationSettings, to dispatch: Dispatch, scope: DispatchScope, completion: @escaping (Dispatch?) -> Void) -> any DisposableReturn Value
A
Disposablethat cancels in-progress work, orDisposables.disposed()if there is nothing to cancel. - Threading: This method is called on the Tealium queue, and the caller disposes the returned
-
factoryExtension methodReturns a
BasicModuleFactoryfor 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 }
View on GitHub