mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-12-24 17:47:15 +00:00
small improvement in AccumulatorFlow
This commit is contained in:
parent
b915f6ece2
commit
18c608f569
@ -2,6 +2,9 @@
|
||||
|
||||
## 0.23.2
|
||||
|
||||
* `Coroutines`:
|
||||
* Small refactor in `AccumulatorFlow` to use `runCatching` instead of `runCatchingSafely`
|
||||
|
||||
## 0.23.1
|
||||
|
||||
* `Versions`:
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user