Events can run at the beginning of a chunk rotation, at the end of a chunk rotation or at a periodic interval.
Events with the same period runs in the same order as users added them. Temporarily disabling events don't impact the order of execution.
A best effort is made to run events with different periods at the same time. For example, an event that runs every two seconds executes half of the time with the events that run every second.
| Modifier and Type | Field and Description |
|---|---|
| private static final BatchManager | |
| private static final FlushTask | |
| private static long | |
| private static final AtomicLong | |
| private static final TaskRepository |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public static void | |
| public static void | |
| public static void | |
| public static long | |
| public static boolean | |
| public static void | |
| public static void |
| batchManager | back to summary |
|---|---|
| private static final BatchManager batchManager | |
| flushTask | back to summary |
|---|---|
| private static final FlushTask flushTask | |
| lastTimeMillis | back to summary |
|---|---|
| private static long lastTimeMillis | |
| settingsIteration | back to summary |
|---|---|
| private static final AtomicLong settingsIteration | |
| taskRepository | back to summary |
|---|---|
| private static final TaskRepository taskRepository | |
| PeriodicEvents | back to summary |
|---|---|
| public PeriodicEvents() | |
| addJavaEvent | back to summary |
|---|---|
| public static void addJavaEvent(Class<? extends Event> eventClass, Runnable runnable) | |
| addJVMEvent | back to summary |
|---|---|
| public static void addJVMEvent(PlatformEventType eventType) | |
| doChunkBegin | back to summary |
|---|---|
| public static void doChunkBegin(boolean startRecording) | |
| doChunkEnd | back to summary |
|---|---|
| public static void doChunkEnd() | |
| doPeriodic | back to summary |
|---|---|
| public static long doPeriodic() | |
| removeEvent | back to summary |
|---|---|
| public static boolean removeEvent(Runnable runnable) | |
| setChanged | back to summary |
|---|---|
| public static void setChanged() Marks that a change has happened to a periodic event. This method should be invoked if a periodic event has:
The periodic task thread will poll the changed state at least once every second to see if a change has occurred. if that's the case, it will refresh periodic tasks that need to be run. | |
| setFlushInterval | back to summary |
|---|---|
| public static void setFlushInterval(long millis) | |