Prefetcher

interface Prefetcher

Provides ability to prefetch content of lenses before they are applied using a Processor. The amount of lenses content that gets prefetched is limited by the Cache.Configuration provided to LensesComponent.

Types

Link copied to clipboard
Link copied to clipboard

Possible states of lens content availability for local use.

Functions

Link copied to clipboard

Allows to observe individual lens content loading Status.

Link copied to clipboard
abstract fun run(lenses: List<LensesComponent.Lens>, callback: Consumer<Boolean> = Consumer {}): Closeable

Starts a new operation to prefetch content for the provided list of lenses. The callback receives True when operation completes successfully or False if it fails or is interrupted before completion. The returned Closeable can be used to cancel the operation. However, if Closeable is ignored, then any incomplete prefetch operation will be cancelled once LensesComponent is closed.

Inheritors

Link copied to clipboard