1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +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.CoroutineScope
import kotlinx.coroutines.channels.BroadcastChannel import kotlinx.coroutines.channels.BroadcastChannel
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.* import kotlinx.coroutines.flow.*
/** /**
@ -11,7 +10,7 @@ import kotlinx.coroutines.flow.*
fun <T> aggregateFlows( fun <T> aggregateFlows(
withScope: CoroutineScope, withScope: CoroutineScope,
vararg flows: Flow<T>, vararg flows: Flow<T>,
internalBufferSize: Int = Channel.BUFFERED internalBufferSize: Int = 64
): Flow<T> { ): Flow<T> {
val sharedFlow = MutableSharedFlow<T>(extraBufferCapacity = internalBufferSize) val sharedFlow = MutableSharedFlow<T>(extraBufferCapacity = internalBufferSize)
val bc = BroadcastChannel<T>(internalBufferSize) val bc = BroadcastChannel<T>(internalBufferSize)