firebase-kotlin-sdk
firebase-kotlin-sdk copied to clipboard
Docs: incorrect documentation about flows being cold
The README.md states, emphasis mine:
The flows are cold which means a new listener is added every time a terminal operator is applied to the resulting flow. A buffer with the default size is used to buffer values received from the listener, use the buffer operator on the flow to specify a user-defined value and to control what happens when data is produced faster than consumed, i.e. to control the back-pressure behavior. Often you are only interested in the latest value received, in this case you can use the conflate operator to disable buffering.
The listener is removed once the flow completes or is cancelled.
For realtime database, this is incorrect: the flow is hot. See discussion in https://github.com/GitLiveApp/firebase-kotlin-sdk/issues/75#issuecomment-775745033.
This is an important distinction because terminal operators like toList() will never complete.