Package io.ktor.util.pipeline

Types

Link copied to clipboard

DslMarker for pipeline execution context

Link copied to clipboard
class InvalidPhaseException(message: String) : Throwable

An exception about misconfigured phases in a pipeline

Link copied to clipboard
open class Pipeline<TSubject : Any, TContext : Any>(phases: PipelinePhase)

Represents an execution pipeline for asynchronous extensible computations

Link copied to clipboard
interface PipelineContext<TSubject : Any, TContext : Any> : CoroutineScope

Represents running execution of a pipeline

Link copied to clipboard
interface PipelineExecutor<R>

Represent an object that launches pipeline execution

Link copied to clipboard
typealias PipelineInterceptor<TSubject, TContext> = suspend PipelineContext<TSubject, TContext>.(TSubject) -> Unit

Represents an interceptor type which is a suspend extension function for context

Link copied to clipboard
class PipelinePhase(name: String)

Represents a phase in a pipeline

Functions

Link copied to clipboard
inline suspend fun <TContext : Any> Pipeline<Unit, TContext>.execute(context: TContext)

Executes this pipeline

Link copied to clipboard
inline fun <TSubject : Any, TContext : Any> Pipeline<*, TContext>.intercept(phase: PipelinePhase, noinline block: suspend PipelineContext<TSubject, TContext>.(TSubject) -> Unit)

Intercepts an untyped pipeline when the subject is of the given type

Link copied to clipboard
fun <TSubject : Any, TContext : Any> pipelineExecutorFor(context: TContext, interceptors: List<PipelineInterceptor<TSubject, TContext>>, subject: TSubject): PipelineExecutor<TSubject>

Build a pipeline of the specified interceptors and create executor.