Interface EventCoordinator
- All Known Implementing Classes:
JpaPollingEventCoordinator
Coordinates appended events notifications for event storage engines.
Implementations can notify only within the current process, or coordinate between multiple instances using mechanisms such as polling, messaging, or database notifications.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a handle to a coordination instance, allowing the engine to notify of new events and to terminate the coordination. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EventCoordinatorA coordinator that only forwards append notifications within a single event storage engine. -
Method Summary
Modifier and TypeMethodDescriptionstartCoordination(Runnable onAppendDetected) Starts a coordination instance that will invoke the given callback when new events are appended.
-
Field Details
-
SIMPLE
A coordinator that only forwards append notifications within a single event storage engine. It does not coordinate between multiple instances.
-
-
Method Details
-
startCoordination
Starts a coordination instance that will invoke the given callback when new events are appended.The callback may be invoked on an arbitrary thread. Implementations should ensure the callback does not perform long-running or blocking operations. If the callback throws an exception, the coordination is terminated.
- Parameters:
onAppendDetected- the callback to invoke when new events are detected; must not benull- Returns:
- a handle to interact with the coordination instance, including notifying of new events and terminating
the coordination; never
null
-