Interface CommandHandler

All Known Implementing Classes:
BroadcastHandler, CoalescingWrites, LoggingHandler, SanityChecker, VisitorHandler

@ProviderType public interface CommandHandler
The CommandHandler is the mechanism through which a CommandStream can be processed synchronously, as the stream is written.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This method is called when the stream has been closed.
    void
    onEmit(Command command)
    Allows this handler to process the Command that was just written into the stream to which this handler was attached.
    void
    onError(String errorMessage)
    Allows this handler to process error states.
  • Method Details

    • onEmit

      void onEmit(Command command)
      Allows this handler to process the Command that was just written into the stream to which this handler was attached.
      Parameters:
      command - the received command
    • onError

      void onError(String errorMessage)
      Allows this handler to process error states.
      Parameters:
      errorMessage - the error's message
    • onDone

      void onDone()
      This method is called when the stream has been closed. The contract is that after this call, no other commands or errors will be emitted.