Interface ConsumerService<Context>

Type Parameters:
Context - Context
All Superinterfaces:
Consumer<Context>, Function<Context,State>, Service<Context,State>, SideEffectService<Context>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ConsumerService<Context> extends SideEffectService<Context>, Consumer<Context>
Service type where each implementation gets a chance to consume the context. This service type effectively turns the pipeline into an event bus.

A service can forcefully terminate execution by calling interrupt()

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(@NonNull Context context)
    Accept the context.
    default @NonNull State
    handle(@NonNull Context context)
    Consumes the context, if possible.
    static void
    Immediately terminate the execution and return State.ACCEPTED

    Methods inherited from interface java.util.function.Consumer

    andThen

    Methods inherited from interface java.util.function.Function

    andThen, compose

    Methods inherited from interface cloud.commandframework.services.types.Service

    apply, order