asFlow

abstract override fun asFlow(): Flow<RealmResults<T>>

Finds all objects that fulfill the query conditions and returns them asynchronously as a Flow.

If there is any changes to the objects represented by the query backing the RealmResults, the flow will emit the updated results. The flow will continue running indefinitely until canceled.

The change calculations will run on the thread represented by RealmConfiguration.Builder.notificationDispatcher.

It is not allowed to call asFlow on queries generated from a MutableRealm.

Return

a flow representing changes to the RealmResults resulting from running this query.