AsyncQueryPagingSource

internal class AsyncQueryPagingSource<RowType : Any, ItemType : Any>(countQuery: Query<Long>, context: CoroutineContext, queryProvider: (limit: Long, offset: Long) -> Query<RowType>, initialOffset: Long = 0, postProcessor: suspend (List<RowType>) -> List<ItemType>, transacter: SuspendingTransacter? = null) : PagingSource<Int, ItemType> , Query.Listener

Loads a page of query rows and optionally enriches them in one database transaction. The postprocessor must preserve row count and order so offsets remain valid.

Constructors

Link copied to clipboard
constructor(countQuery: Query<Long>, context: CoroutineContext, queryProvider: (limit: Long, offset: Long) -> Query<RowType>, initialOffset: Long = 0, postProcessor: suspend (List<RowType>) -> List<ItemType>, transacter: SuspendingTransacter? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val invalid: Boolean
Link copied to clipboard
@get:VisibleForTesting
internal val invalidateCallbackCount: Int
Link copied to clipboard
open override val jumpingSupported: Boolean
Link copied to clipboard
open val keyReuseSupported: Boolean

Functions

Link copied to clipboard
open override fun getRefreshKey(state: PagingState<Int, ItemType>): Int?
Link copied to clipboard
Link copied to clipboard
open suspend override fun load(params: PagingSource.LoadParams<Int>): PagingSource.LoadResult<Int, ItemType>
Link copied to clipboard
open override fun queryResultsChanged()
Link copied to clipboard
fun registerInvalidatedCallback(onInvalidatedCallback: () -> Unit)
Link copied to clipboard
fun unregisterInvalidatedCallback(onInvalidatedCallback: () -> Unit)