leandro
11/25/2020, 8:37 PMwbertan
11/25/2020, 8:39 PMSharedFlowleandro
11/25/2020, 8:46 PMwbertan
11/25/2020, 9:00 PMonSubscriptionMutableSharedFlow<Long>(
    0,
    extraBufferCapacity = 1,
    onBufferOverflow = BufferOverflow.DROP_OLDEST
).onSubscription {
    while(true) {
        emit(System.currentTimeMillis())
        delay(5_000)
    }
}elizarov
11/25/2020, 9:08 PMwbertan
11/25/2020, 9:25 PMclass AsasTest {
    val a = MutableSharedFlow<Long>(
        replay = 0, extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST
    ).onSubscription {
        val id = UUID.randomUUID().toString()
        println("creating flow $id")
        while (true) {
            println("emit flow $id")
            emit(System.currentTimeMillis())
            delay(5_000)
        }
    }
    @Test
    fun testAsasA() {
        runBlocking {
            a.onEach { println("a1 $it") }.launchIn(this)
            a.onEach { println("a2 $it") }.launchIn(this)
        }
    }
}creating flow 7e83c9c0-af30-4621-99a7-87dfc3c4fbc9
emit flow 7e83c9c0-af30-4621-99a7-87dfc3c4fbc9
a1 1606339289726
creating flow 83a59d4a-8394-49e8-b11b-ca7309917fde
emit flow 83a59d4a-8394-49e8-b11b-ca7309917fde
a2 1606339289739
emit flow 7e83c9c0-af30-4621-99a7-87dfc3c4fbc9
a1 1606339294743
emit flow 83a59d4a-8394-49e8-b11b-ca7309917fde
a2 1606339294743
emit flow 7e83c9c0-af30-4621-99a7-87dfc3c4fbc9
a1 1606339299747
emit flow 83a59d4a-8394-49e8-b11b-ca7309917fde
a2 1606339299748val b = flow {
        val id = UUID.randomUUID().toString()
        println("creating flow $id")
        while(true) {
            println("emit flow $id")
            emit(System.currentTimeMillis())
            delay(5_000)
        }
    }FlowSharedFlowval c = flow {
        val id = UUID.randomUUID().toString()
        println("creating flow $id")
        while(true) {
            println("emit flow $id")
            emit(System.currentTimeMillis())
            delay(5_000)
        }
    }.shareIn(<What I should put here to share?>)shareInvalCoroutineScopeObservable.share()ursus
11/25/2020, 9:50 PMnow()onStart(emit(now())