🌈 Create new beautiful Compose Gradients with our new wesite ->
Interface

PrefetchScheduler

Implementations of this interface accept prefetch requests via schedulePrefetch and decide when to execute them in a way that will have minimal impact on user experience, e.g.

Source set: Common
public interface PrefetchScheduler

Implementations of this interface accept prefetch requests via schedulePrefetch and decide when to execute them in a way that will have minimal impact on user experience, e.g. during frame idle time.

Requests should be executed by invoking PrefetchRequest.execute. The implementation of PrefetchRequest.execute will return false when all work for that request is done, or true when it still has more to do but doesn't think it can complete it within PrefetchRequestScope.availableTimeNanos.

Functions

schedulePrefetch

Source set: Common
public fun schedulePrefetch(prefetchRequest: PrefetchRequest)

Accepts a prefetch request. Implementations should find a time to execute them which will have minimal impact on user experience.