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

io.undertow.server.handlers.BlockingHandler.scala Maven / Gradle / Ivy

The newest version!
package io.undertow.server.handlers

import io.undertow.server._
import scala.scalanative.meta.LinktimeInfo

final class BlockingHandler(handler: HttpHandler) extends HttpHandler {
  def handleRequest(exchange: HttpServerExchange): Unit = {
    exchange.startBlocking()
    if (LinktimeInfo.isMultithreadingEnabled) {
      scala.concurrent.ExecutionContext.global.execute(() =>
        try { handler.handleRequest(exchange) }
        finally { exchange.endExchange() }
      )
    } else {
      try { handler.handleRequest(exchange) }
      finally { exchange.endExchange() }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy