Enum Class DispatchMode

java.lang.Object
java.lang.Enum<DispatchMode>
com.framed.core.utils.DispatchMode
All Implemented Interfaces:
Serializable, Comparable<DispatchMode>, Constable

public enum DispatchMode extends Enum<DispatchMode>
Strategy for how an event bus invokes the handlers registered for an address.

Used by event bus implementations (such as LocalEventBus and SocketEventBus) to decide on which thread each registered handler runs.

  • Enum Constant Details

    • SEQUENTIAL

      public static final DispatchMode SEQUENTIAL
      All handlers run sequentially, inline on the calling (publishing) thread.
    • PARALLEL

      public static final DispatchMode PARALLEL
      Each handler invocation is submitted to a shared thread pool and runs concurrently.
    • PER_HANDLER

      public static final DispatchMode PER_HANDLER
      Each handler gets its own single-thread executor, preserving per-handler FIFO ordering.
  • Method Details

    • values

      public static DispatchMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DispatchMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null