mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-12-22 14:15:45 +00:00
updates after coroutines version change
This commit is contained in:
@@ -13,10 +13,11 @@ fun <T> aggregateFlows(
|
||||
vararg flows: Flow<T>,
|
||||
internalBufferSize: Int = Channel.BUFFERED
|
||||
): Flow<T> {
|
||||
val sharedFlow = MutableSharedFlow<T>(extraBufferCapacity = internalBufferSize)
|
||||
val bc = BroadcastChannel<T>(internalBufferSize)
|
||||
flows.forEach {
|
||||
it.onEach {
|
||||
safely { bc.send(it) }
|
||||
safely { sharedFlow.emit(it) }
|
||||
}.launchIn(withScope)
|
||||
}
|
||||
return bc.asFlow()
|
||||
|
||||
Reference in New Issue
Block a user