PrefetchRequest

Interface

Common

Deprecated Customization of PrefetchScheduler is no longer supported. LazyLayout will attach an appropriate scheduler internally. If you needed to customize it please file a Feature Request.

@ExperimentalFoundationApi
sealed interface PrefetchRequest

A request for prefetch which can be submitted to a PrefetchScheduler to execute during idle time.

Functions

fun PrefetchRequestScope.execute(): Boolean

Gives this request a chance to execute work. It should only do work if it thinks it can finish it within PrefetchRequestScope.availableTimeNanos.

Returns

whether this request has more work it wants to do, but ran out of time. true indicates this request wants to have execute called again to do more work, while false indicates its work is complete.