From 829486de1ee00850110118f0138d709eaa3e4c93 Mon Sep 17 00:00:00 2001 From: Aleksei Tirman Date: Wed, 19 Jun 2024 10:32:43 +0300 Subject: [PATCH] KTOR-7054 Replace imports to internal coroutines classes with internal Ktor classes --- ktor-shared/ktor-events/common/src/io/ktor/events/Events.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ktor-shared/ktor-events/common/src/io/ktor/events/Events.kt b/ktor-shared/ktor-events/common/src/io/ktor/events/Events.kt index ec9b54e16a1..30db37a37e5 100644 --- a/ktor-shared/ktor-events/common/src/io/ktor/events/Events.kt +++ b/ktor-shared/ktor-events/common/src/io/ktor/events/Events.kt @@ -5,10 +5,10 @@ package io.ktor.events import io.ktor.util.collections.* +import io.ktor.util.internal.* import io.ktor.util.logging.* import io.ktor.utils.io.* import kotlinx.coroutines.* -import kotlinx.coroutines.internal.* @OptIn(InternalAPI::class) public class Events { @@ -19,7 +19,6 @@ public class Events { */ public fun subscribe(definition: EventDefinition, handler: EventHandler): DisposableHandle { val registration = HandlerRegistration(handler) - @OptIn(InternalCoroutinesApi::class) handlers.computeIfAbsent(definition) { LockFreeLinkedListHead() }.addLast(registration) return registration } @@ -52,7 +51,6 @@ public class Events { exception?.let { throw it } } - @OptIn(InternalCoroutinesApi::class) private class HandlerRegistration(val handler: EventHandler<*>) : LockFreeLinkedListNode(), DisposableHandle { override fun dispose() { remove() @@ -85,6 +83,6 @@ public typealias EventHandler = (T) -> Unit * Inheriting of this class is an experimental feature. * Instantiate directly if inheritance not necessary. * - * @param T specifies what is a type of a value passed to the event + * @param T specifies what is a type of value passed to the event */ public open class EventDefinition