asFlow

abstract fun asFlow(): <ERROR CLASS><ResultsChange<T>>

Observe changes to the RealmResult. Once subscribed the flow will emit a InitialResults event and then a UpdatedResults on any change to the objects represented by the query backing the RealmResults. The flow will continue running indefinitely except if the results are from a backlinks property, then they will stop once the target object is deleted.

The change calculations will on on the thread represented by Configuration.SharedBuilder.notificationDispatcher.

The flow has an internal buffer of Channel.BUFFERED but if the consumer fails to consume the elements in a timely manner the coroutine scope will be cancelled with a CancellationException.

Return

a flow representing changes to the RealmResults.