Klasse NonOverlappingTask

java.lang.Object
de.delinkedde.areashopreborn.application.NonOverlappingTask
Alle implementierten Schnittstellen:
Runnable

public final class NonOverlappingTask extends Object implements Runnable
Runs an asynchronous scheduled operation at most once concurrently.

A scheduler tick that occurs while the previous stage is incomplete is intentionally skipped. This prevents slow storage or integrations from creating an ever-growing backlog.

  • Konstruktordetails

    • NonOverlappingTask

      public NonOverlappingTask(Supplier<? extends CompletionStage<?>> operation, Consumer<Throwable> failureHandler)
      Creates a guarded asynchronous task.
      Parameter:
      operation - operation started on an accepted scheduler tick
      failureHandler - handler for synchronous and asynchronous failures
  • Methodendetails

    • run

      public void run()
      Starts the operation unless an earlier invocation is still incomplete.
      Angegeben von:
      run in Schnittstelle Runnable
    • isRunning

      public boolean isRunning()
      Reports whether an invocation is currently active.
      Gibt zurück:
      true while the guarded completion stage is incomplete