Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KTOR-7054 Replace imports to internal coroutines classes with interna… #4091

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ktor-shared/ktor-events/common/src/io/ktor/events/Events.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -19,7 +19,6 @@ public class Events {
*/
public fun <T> subscribe(definition: EventDefinition<T>, handler: EventHandler<T>): DisposableHandle {
val registration = HandlerRegistration(handler)
@OptIn(InternalCoroutinesApi::class)
handlers.computeIfAbsent(definition) { LockFreeLinkedListHead() }.addLast(registration)
return registration
}
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -85,6 +83,6 @@ public typealias EventHandler<T> = (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<T>
Loading