Klasse ThreadBridge

java.lang.Object
de.delinkedde.areashopreborn.application.ThreadBridge

public final class ThreadBridge extends Object
Bridges asynchronous database stages back to Paper's server thread.
  • Konstruktordetails

    • ThreadBridge

      public ThreadBridge(org.bukkit.plugin.Plugin plugin)
      Creates a server-thread bridge.
      Parameter:
      plugin - scheduler owner
  • Methodendetails

    • supplySync

      public <T> CompletableFuture<T> supplySync(Supplier<T> supplier)
      Executes a value-producing operation on the server thread.
      Typparameter:
      T - result type
      Parameter:
      supplier - operation requiring the Paper thread
      Gibt zurück:
      completion future
    • supplySyncChecked

      public <T> CompletableFuture<T> supplySyncChecked(ThreadBridge.CheckedSupplier<T> supplier)
      Executes a value-producing operation that may throw a checked exception on the server thread.
      Typparameter:
      T - result type
      Parameter:
      supplier - checked operation
      Gibt zurück:
      completion future containing the result or checked failure
    • runSync

      Executes an operation on the server thread.
      Parameter:
      runnable - operation requiring the Paper thread
      Gibt zurück:
      completion future