Interface PartialResultService<Context,Result,Chunked extends ChunkedRequestContext<Context,Result>>

Type Parameters:
Context - Context type
Result - Result type
Chunked - Chunk request context
All Superinterfaces:
Function<Chunked,@Nullable Map<Context,Result>>, Service<Chunked,@Nullable Map<@NonNull Context,@NonNull Result>>

public interface PartialResultService<Context,Result,Chunked extends ChunkedRequestContext<Context,Result>> extends Service<Chunked,@Nullable Map<@NonNull Context,@NonNull Result>>
Service type that allows service to generate partial results for bigger requests
  • Method Details

    • handle

      Description copied from interface: Service
      Provide a response for the given context. If the service implementation cannot provide a response for the given context, it should return null
      Specified by:
      handle in interface Service<Context,Result>
      Parameters:
      context - Context used in the generation of the response
      Returns:
      Response. If the response isn't null, the next service in the service chain will get to act on the context. Otherwise the execution halts, and the provided response is the final response.
    • handleRequests

      Attempt to generate results for a list of requests, and return a map of all successful requests
      Parameters:
      requests - Requests
      Returns:
      Map of request-result pairs