From 3bbf978b0048eaa7860d15d91704cb509fe35458 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 21 Jul 2025 22:02:30 +0600 Subject: [PATCH] fixes in actorAsync --- .../kotlin/dev/inmo/micro_utils/coroutines/ActorAsync.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/ActorAsync.kt b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/ActorAsync.kt index 9964a561998..fe9215ada50 100644 --- a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/ActorAsync.kt +++ b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/ActorAsync.kt @@ -1,5 +1,6 @@ package dev.inmo.micro_utils.coroutines +import dev.inmo.kslog.common.KSLog import kotlinx.coroutines.* import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.consumeAsFlow @@ -7,13 +8,15 @@ import kotlinx.coroutines.flow.consumeAsFlow fun CoroutineScope.actorAsync( channelCapacity: Int = Channel.UNLIMITED, markerFactory: suspend (T) -> Any? = { null }, + logger: KSLog = KSLog, block: suspend (T) -> Unit ): Channel { val channel = Channel(channelCapacity) - channel.consumeAsFlow().subscribeAsync(this, markerFactory, block) + channel.consumeAsFlow().subscribeAsync(this, markerFactory, logger, block) return channel } +@Deprecated("Use standard actosAsync instead", ReplaceWith("actorAsync(channelCapacity, markerFactory, block = block)", "dev.inmo.micro_utils.coroutines.actorAsync")) inline fun CoroutineScope.safeActorAsync( channelCapacity: Int = Channel.UNLIMITED, noinline onException: ExceptionHandler = defaultSafelyExceptionHandler,