ktor-http-cio / io.ktor.http.cio / kotlinx.coroutines.CoroutineScope

Extensions for kotlinx.coroutines.CoroutineScope

decodeChunked

fun CoroutineScope.decodeChunked(input: ByteReadChannel): DecoderJob
fun CoroutineScope.decodeChunked(input: ByteReadChannel, contentLength: Long): DecoderJob

Start a chunked stream decoder coroutine

parseMultipart

fun CoroutineScope.parseMultipart(input: ByteReadChannel, headers: HttpHeadersMap): ReceiveChannel<MultipartEvent>
fun CoroutineScope.parseMultipart(input: ByteReadChannel, contentType: CharSequence, contentLength: Long?): ReceiveChannel<MultipartEvent>
fun CoroutineScope.parseMultipart(boundaryPrefixed: ByteBuffer, input: ByteReadChannel, totalLength: Long?): ReceiveChannel<MultipartEvent>

Starts a multipart parser coroutine producing multipart events

startConnectionPipeline

fun CoroutineScope.startConnectionPipeline(input: ByteReadChannel, output: ByteWriteChannel, timeout: WeakTimeoutQueue, handler: suspend CoroutineScope.(request: Request, input: ByteReadChannel, output: ByteWriteChannel, upgraded: CompletableDeferred<Boolean>?) -> Unit): Job

Start connection HTTP pipeline invoking handler for every request. Note that handler could be invoked multiple times concurrently due to HTTP pipeline nature