net.pincette.netty.http.RequestAccumulator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pincette-netty-http Show documentation
Show all versions of pincette-netty-http Show documentation
A simple Netty HTTP server and client
package net.pincette.netty.http;
import static net.pincette.netty.http.Util.asInputStream;
import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.HttpResponse;
import java.util.concurrent.Flow.Publisher;
import net.pincette.rs.Accumulator;
/**
* Accumulates a request and when that's done it calls the request handler.
*
* @author Werner Donné
* @since 1.0
*/
public class RequestAccumulator extends Accumulator> {
public RequestAccumulator(
final HttpRequest request,
final HttpResponse response,
final RequestHandlerAccumulated requestHandler) {
super(
buffers -> requestHandler.apply(request, asInputStream(buffers), response),
ByteBuf::retain);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy