https://kotlinlang.org logo
#ktor
Title
# ktor
a

Alexander

07/19/2019, 10:45 AM
Shouldn't event handlers in ktor be a
suspend
functions? At the moment I cannot use synchronization primitives (channels, mutexes) inside them.
It is about:
Copy code
typealias EventHandler<T> = (T) -> Unit
My example:
Copy code
pipeline.environment.monitor.subscribe(Routing.RoutingCallStarted) { call ->
    // Here I want to take a mutex or send any message into a channel
}
11 Views