Interface MainEventBusProcessorCallback


public interface MainEventBusProcessorCallback
Callback interface for MainEventBusProcessor events.

This interface is primarily intended for testing, allowing tests to synchronize with the asynchronous MainEventBusProcessor. Production code should not rely on this.

Usage in tests:
 
 @Inject
 MainEventBusProcessor processor;

 @BeforeEach
 void setUp() {
     CountDownLatch latch = new CountDownLatch(3);
     processor.setCallback(new MainEventBusProcessorCallback() {
         public void onEventProcessed(String taskId, Event event) {
             latch.countDown();
         }
     });
 }

 @AfterEach
 void tearDown() {
     processor.setCallback(null); // Reset to NOOP
 }
 
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    No-op implementation that does nothing.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onEventProcessed(String taskId, Event event)
    Called after an event has been fully processed (persisted, notification sent, distributed to children).
    void
    Called when a task reaches a final state (COMPLETED, FAILED, CANCELED, REJECTED).
  • Field Details

    • NOOP

      static final MainEventBusProcessorCallback NOOP
      No-op implementation that does nothing. Used as the default callback to avoid null checks.
  • Method Details

    • onEventProcessed

      void onEventProcessed(String taskId, Event event)
      Called after an event has been fully processed (persisted, notification sent, distributed to children).
      Parameters:
      taskId - the task ID
      event - the event that was processed
    • onTaskFinalized

      void onTaskFinalized(String taskId)
      Called when a task reaches a final state (COMPLETED, FAILED, CANCELED, REJECTED).
      Parameters:
      taskId - the task ID that was finalized