createPagingSource

abstract fun createPagingSource(query: Q, lifecycleOwner: LifecycleOwner): IviPagingSource<E>

Creates an IviPagingSource for the given query. The page source is invalidated when the given lifecycleOwner is destroyed.

This is a non suspendable method, as such its implementation on the client side cannot be blocked on IO to create the paging source on the service side. This is required for the Android Paging library integration. The page source is created on the service side asynchronously. Any exception thrown while doing this, is deferred to the first IviPagingSource.load call and reported as an IviPagingSource.LoadResult.Error.