Class HandlerWatchdog

java.lang.Object
dev.tachyonmcp.core.server.HandlerWatchdog

@InternalApi public final class HandlerWatchdog extends Object
Fires a log entry at configurable thresholds when a handler takes longer than expected. Does not capture a thread reference — suitable for async handler pipelines where the continuation may run on any thread.
  • Method Details

    • watch

      public static Future<?> watch(Object method, RequestId id, long startNs, long delayMs)
      Schedules a watchdog that fires after delayMs milliseconds and logs a warning. Cancel the returned Future (with cancel(false)) when the handler completes normally. When debug logging is disabled the output can never be seen, so no timer is scheduled at all — avoids per-request schedule/cancel churn on the single timer thread.