connectionStateAsFlow

Create a Flow of ConnectionStateChange-events to receive notifications of updates to the session's connection state.

The flow will be completed if the realm is closed.

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