All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.kr.jadekim.jext.ktor.hook.PhaseHook.kt Maven / Gradle / Ivy

The newest version!
package kr.jadekim.jext.ktor.hook

import io.ktor.server.application.*
import io.ktor.util.pipeline.*

class PhaseHook(val phase: PipelinePhase) : Hook {

    override fun install(pipeline: ApplicationCallPipeline, handler: HookHandler) {
        pipeline.intercept(phase) {
            with(HookContext(call, ::proceed, coroutineContext)) {
                handler()
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy