The liveData {
coroutine builder's block
is only executed while the LiveData is active. The block runner is cancelled after a given timeout period, which is by default 5 seconds.
So while(true) {
will stop after 5 seconds. You can pass liveData(timeoutInMs = 0) {
to immediately terminate the loop.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…