tseisel
10/04/2019, 2:59 PMFlowable.never()
)
Is something like this correct ?
object NeverFlow : Flow<Nothing> {
override suspend fun collect(collector: FlowCollector<Nothing>) {
delay(Long.MAX_VALUE)
}
}
streetsofboston
10/04/2019, 3:01 PMval flow: Flow<Nothing> = flow {
suspendCancellableCoroutine { /* do nothing */ }
}
streetsofboston
10/04/2019, 3:03 PMdelay(Long.MAX_VALUE)
call with an empty suspendCancellableCoroutine
callelizarov
10/05/2019, 4:16 PMLong.MAX_VALUE
— it assumes you suspend forever.streetsofboston
10/05/2019, 5:26 PMdelay(Long.MAX_VALUE)
, due to Long.MAX_VALUE rolling over to a negative value of you add just 1 millisecond. Maybe that has been fixed in the latest coroutines-test libraries. If not, calling delay(Long.MAX_VALUE - 1)
may still have that roll-over issue...