# PrefetchRequest

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/lazy/layout/PrefetchScheduler.kt+class:androidx.compose.foundation.lazy.layout.PrefetchRequest) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0) Deprecated in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.9.0) Common/AllAndroid/JVM
- Cmn

  ```
  @ExperimentalFoundationApi
  sealed interface PrefetchRequest
  ```

*** ** * ** ***

> [!CAUTION]
> **This interface is 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.

A request for prefetch which can be submitted to a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/layout/PrefetchScheduler` to execute during idle time.

## Summary

| ### Public functions |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/layout/PrefetchRequestScope.[execute](https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/layout/PrefetchRequest#(androidx.compose.foundation.lazy.layout.PrefetchRequestScope).execute())()` **This function is deprecated.** Customization of PrefetchScheduler is no longer supported. | Cmn |

## Public functions

### PrefetchRequestScope.execute

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/lazy/layout/PrefetchScheduler.kt+function:execute) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.7.0) Deprecated in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.9.0)

```
fun PrefetchRequestScope.[execute](https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/layout/PrefetchRequest#(androidx.compose.foundation.lazy.layout.PrefetchRequestScope).execute())(): Boolean
```

> [!CAUTION]
> **This function is 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.

Gives this request a chance to execute work. It should only do work if it thinks it can finish it within `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/layout/PrefetchRequestScope#availableTimeNanos()`.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | whether this request has more work it wants to do, but ran out of time. `true` indicates this request wants to have `https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/layout/PrefetchRequest#(androidx.compose.foundation.lazy.layout.PrefetchRequestScope).execute()` called again to do more work, while `false` indicates its work is complete. |