ModuleProxy

interface ModuleProxy<T : Module>

A ModuleProxy is to be used for proxying access to modules that are or were available to access from the main Tealium implementation.

Any external Module implementation that provides functionality expected to be used by a developer should wrap their access to Tealium through a ModuleProxy.

Functions

Link copied to clipboard

Eagerly executes a task for the Module. The task should use the provided callback to emit a result to the returned Observable.

Link copied to clipboard
abstract fun <R> executeModuleTask(task: (T) -> R): Single<TealiumResult<R>>

Eagerly executes a task for the Module, with the result returned as a TealiumResult

Link copied to clipboard
abstract fun getModule(callback: Callback<T?>)

Retrieves the Module, providing it in the callback.

Link copied to clipboard
abstract fun observeModule(): Subscribable<T?>

Observe an Observable of the Module regardless of if the Module is currently enabled or not.

abstract fun <R> observeModule(transform: (T) -> Observable<R>): Subscribable<R>

Observes an Observable derived from the Module, re-deriving it as the module's availability changes.

Link copied to clipboard
abstract fun <R> observeModuleResult(transform: (T) -> Observable<R>): Subscribable<TealiumResult<R>>

Observes an Observable derived from the Module, re-deriving it as the module's availability changes.

Link copied to clipboard
abstract fun <R> observeModules(transform: (List<T>) -> Observable<R>): Subscribable<R>

Observe observables from all Module instances of type T.