Interface PartialResultService<Context,Result,Chunked extends ChunkedRequestContext<Context,Result>>
- Type Parameters:
Context- Context typeResult- Result typeChunked- 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 Summary
Modifier and TypeMethodDescriptionProvide a response for the given context.handleRequests(@NonNull List<Context> requests) Attempt to generate results for a list of requests, and return a map of all successful requests
-
Method Details
-
handle
Description copied from interface:ServiceProvide a response for the given context. If the service implementation cannot provide a response for the given context, it should returnnull- Specified by:
handlein interfaceService<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
-