Class PanelResponderRegistry.Invocation

java.lang.Object
com.ultikits.ultitools.websocket.PanelResponderRegistry.Invocation
All Implemented Interfaces:
Runnable
Enclosing class:
PanelResponderRegistry

private final class PanelResponderRegistry.Invocation extends Object implements Runnable
One admitted request: the responder entry captured at admission, its deadline and its outcome. Runs on a worker; every settlement goes through settle(com.google.gson.JsonElement, java.lang.Throwable).
  • Field Details

  • Constructor Details

  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • endWork

      private void endWork()
      Runs workEnded once.
    • callResponder

      private CompletableFuture<? extends com.google.gson.JsonElement> callResponder()
      Calls the responder at the framework's boundary to module code: whatever the call throws becomes this request's outcome instead of being lost in the worker. Returns null when the outcome is already settled here.
    • installScope

      private void installScope(UltiToolsPlugin scope)
      Sets this registry's registration scope on the current thread; null removes it.
    • release

      private void release()
      The completion hook: frees the queue slot and the deadline, and stops tracking.
    • refusal

      private RejectedExecutionException refusal()
    • shutDownFailure

      private RejectedExecutionException shutDownFailure()
    • expire

      private void expire()
      The deadline action: take a not-yet-started invocation back, then fail the outcome.
    • settle

      private void settle(com.google.gson.JsonElement value, Throwable failure)
      The one settle path. Cancels the deadline before completing the outcome: a CompletableFuture runs later-registered dependents first, so a caller waiting on the outcome must find the deadline already gone. A second settlement is a no-op.