Interface PartialResultService<Context,Result,Chunked extends ChunkedRequestContext<Context,Result>>
-
- Type Parameters:
Context
- Context typeResult
- Result typeChunked
- Chunk request context
- All Superinterfaces:
java.util.function.Function<Chunked,@Nullable java.util.Map<Context,Result>>
,Service<Chunked,@Nullable java.util.Map<@NonNull Context,@NonNull Result>>
public interface PartialResultService<Context,Result,Chunked extends ChunkedRequestContext<Context,Result>> extends Service<Chunked,@Nullable java.util.Map<@NonNull Context,@NonNull Result>>
Service type that allows service to generate partial results for bigger requests
-
-
Method Summary
Modifier and Type Method Description default @Nullable java.util.Map<@NonNull Context,@NonNull Result>
handle(@NonNull Chunked context)
Provide a response for the given context.@NonNull java.util.Map<@NonNull Context,@NonNull Result>
handleRequests(@NonNull java.util.List<Context> requests)
Attempt to generate results for a list of requests, and return a map of all successful requests
-
-
-
Method Detail
-
handle
default @Nullable java.util.Map<@NonNull Context,@NonNull Result> handle(@NonNull Chunked context)
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 returnnull
- Specified by:
handle
in 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.
-
-