saket
08/13/2021, 4:36 AMSource
?
I’m consuming anfreezes both its upstream source and downstream observer, all the Disposables (upstream’s and downstream’s) are frozen as well, all the values (including errors) are not frozen by the operatorsubscribeOn
Observable
from k/native, and I wanted to confirm that doing this is expected:
upstream.map { it.freeze() }
Arkadii Ivanov
08/13/2021, 9:02 AMsubscribeOn
operator affects only the subscription phase, so it does not freeze emitted values. But observeOn
affects emission, and it does freeze values.Arkadii Ivanov
08/13/2021, 9:05 AMsaket
08/13/2021, 2:39 PMfreezes only its downstream observer and all the values (including errors) passed through it, plus all the Disposables, upstream source is not frozen by the operatorobserveOn
saket
08/13/2021, 2:40 PMWhy do you need to freeze values manually?I’m letting consuming platforms, android and macOS, control the thread where the emissions are observed, which explains why my emissions weren’t getting auto-frozen.