mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-07 09:09:26 +00:00
small improvement in AccumulatorFlow
This commit is contained in:
@@ -68,9 +68,9 @@ class AccumulatorFlow<T>(
|
||||
override suspend fun collectSafely(collector: FlowCollector<T>) {
|
||||
val channel = Channel<T>(Channel.UNLIMITED, BufferOverflow.SUSPEND)
|
||||
steps.send(SubscribeAccumulatorFlowStep(channel))
|
||||
val result = runCatchingSafely {
|
||||
val result = runCatching {
|
||||
for (data in channel) {
|
||||
val emitResult = runCatchingSafely {
|
||||
val emitResult = runCatching {
|
||||
collector.emit(data)
|
||||
}
|
||||
if (emitResult.isSuccess || emitResult.exceptionOrNull() is CancellationException) {
|
||||
|
Reference in New Issue
Block a user