Implementing suspend for@Insert and @Update calls works as expected. However, suspend is not working for @Query calls that return a DataSource.Factory<Int, Content> in order to construct a PagedList. The issue has been outlined in this StackOverflow.

For example this works as expected.

@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertContentList(users: ArrayList<Content?>)

Using suspend for the DataSource.Factory<Int, Content> the app fails to build.

@Query("SELECT * FROM content WHERE timestamp >= :timeframe AND feedType = :feedType ORDER BY timestamp DESC")
suspend fun queryMainContentList(timeframe: Timestamp, feedType: FeedType): DataSource.Factory<Int, Content>

Creator of Coinverse - The 1st Crypto News Audiocast App @

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store