Reactive servlets

Hookless » Adapters » Servlets

Reactive servlet as implemented in ReactiveServlet class is a reactive adapter for Jakarta's HttpServlet. Reactive servlet is a reactive consumer. It will keep running its handler method until the handler no longer reactively blocks. It will then send the last output of the handler to the client as an HTTP response. Reactive servlet is fully asynchronous. It never blocks servlet container threads.

Download

Get Hookless Servlets from Maven Central:

Tool
<dependency>
    <groupId>com.machinezoo.hookless</groupId>
    <artifactId>hookless-servlets</artifactId>
    <version>0.5.2</version>
</dependency>

Or clone sources from GitHub or Bitbucket. Configure your build for Java 8+. Reactive servlets target servlet API 3.1, which means they will run on any Java EE 7+ servlet container. Sources and binaries are distributed under Apache License 2.0.

If your project is a Java module, add the following declaration to your module-info.java:

requires com.machinezoo.hookless.servlets;

Documentation

See servlets package, particularly ReactiveServlet class. Since the javadoc is not complete yet, you might want to take a look at comments and implementation in sources.