1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-18 07:45:27 +00:00

update aggregateFlows

This commit is contained in:
InsanusMokrassar 2020-10-27 15:26:32 +06:00
parent 23a1fed7dd
commit b053c29ea3

View File

@ -2,7 +2,6 @@ package dev.inmo.tgbotapi.extensions.utils
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.channels.BroadcastChannel
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.*
/**
@ -11,7 +10,7 @@ import kotlinx.coroutines.flow.*
fun <T> aggregateFlows(
withScope: CoroutineScope,
vararg flows: Flow<T>,
internalBufferSize: Int = Channel.BUFFERED
internalBufferSize: Int = 64
): Flow<T> {
val sharedFlow = MutableSharedFlow<T>(extraBufferCapacity = internalBufferSize)
val bc = BroadcastChannel<T>(internalBufferSize)