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,