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

net.pincette.netty.http.RequestAccumulator Maven / Gradle / Ivy

There is a newer version: 3.2.4
Show newest version
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