rkeazor
11/13/2020, 5:10 AMlouiscad
11/13/2020, 6:45 AMwithContext
on the collector side, simply.Zach Klippenstein (he/him) [MOD]
11/13/2020, 3:47 PMflowOn
will not do that even for non-state flows. Louis’ withContext
is the solution there too. If the latter, there’s no way to do that generally for StateFlow
because the only implementation of StateFlow
that should be used is MutableStateFlow
, which doesn’t have the concept of operating on any particular dispatcher (since it’s effectively just an observable value holder).louiscad
11/13/2020, 4:17 PMshareIn
to control where the emitter runs by default.rkeazor
11/15/2020, 5:19 PMval _aFlow = MutableSharedFlow<Int>()
val aFlow: Flow<In>
get() = _aFlow
aFlow
.onEach { …}
flowOn(<http://Dispatchers.IO|Dispatchers.IO>}. <— This won't have effect ?
onEach{…Complex commutation }
.launchIn(SomeScope)
rkeazor
11/15/2020, 5:19 PMlouiscad
11/15/2020, 5:32 PMonEach
louiscad
11/15/2020, 5:32 PMflowOn
states quite clearly.