Context - the context type.public interface ConsumerService<Context> extends Service<Context,ConsumerService.State>, java.util.function.BiConsumer<java.util.concurrent.CompletableFuture<ConsumerService.State>,Context>, java.util.function.Consumer<Context>
| Modifier and Type | Interface and Description |
|---|---|
static class |
ConsumerService.State
Represents the state of a
ConsumerService. |
| Modifier and Type | Method and Description |
|---|---|
default void |
accept(java.util.concurrent.CompletableFuture<ConsumerService.State> future,
Context ctx) |
default void |
accept(Context ctx) |
default java.util.concurrent.CompletableFuture<ConsumerService.State> |
handle(Context ctx)
Handles the given context and returns a
CompletableFuture that will be completed with the result. |
default void accept(Context ctx)
accept in interface java.util.function.Consumer<Context>default void accept(java.util.concurrent.CompletableFuture<ConsumerService.State> future, Context ctx)
accept in interface java.util.function.BiConsumer<java.util.concurrent.CompletableFuture<ConsumerService.State>,Context>default java.util.concurrent.CompletableFuture<ConsumerService.State> handle(Context ctx)
ServiceCompletableFuture that will be completed with the result.handle in interface Service<Context,ConsumerService.State>ctx - the context to handle.CompletableFuture that will be completed with the result of handling the context.