Interface FilterContinuation<R>

Type Parameters:
R - The type to return in proceed()

public interface FilterContinuation<R>
A filter continuation gives can be declared as a parameter on a filter method. The filter method gets "delayed" access to the parameter it is requesting. For example, a request filter can declare a continuation that returns the response. When the filter calls the continuation, other downstream filters and the final request call will be executed. The continuation will return once the response has been received and processed by downstream filters.
A continuation can either return the value immediately (e.g. FilterContinuation<HttpResponse<?>>), in which case the call to proceed() will block, or it can return a reactive wrapper (e.g. FilterContinuation<Publisher<HttpResponse<?>>>). With a reactive wrapper, proceed() will not block, and downstream processing will happen asynchronously (after the reactive stream is subscribed to).
  • Method Details

    • request

      Update the request for downstream processing.
      request - The new request
      This continuation, for call chaining
    • proceed

      @NonNull R proceed()
      Proceed processing downstream of this filter. If FilterContinuation is not a reactive type, this method will block until downstream processing completes, and may throw an exception if there is a failure. Blocking netty event loop threads can lead to bugs, so any filter that may block in the netty HTTP server should use ExecuteOn to avoid running on the event loop.
      If FilterContinuation is a reactive type, this method will return immediately. Downstream processing will happen when the reactive stream is subscribed to, and the reactive stream will produce the downstream result when available.
      The downstream result, or reactive stream wrapper thereof