void (DebuggerCommandImpl command, int terminateTimeoutMillis) { final DebuggerCommandImpl currentCommand = myEvents.getCurrentEvent(); invoke(command); if (currentCommand != null) { AppExecutorUtil.getAppScheduledExecutorService().schedule( () -> { if (currentCommand == myEvents.getCurrentEvent()) { // if current command is still in progress, cancel it getCurrentRequest().requestStop(); try { getCurrentRequest().join(); } catch (InterruptedException ignored) { } catch (Exception e) { throw new RuntimeException(e); } finally { if (!myDisposed) { startNewWorkerThread(); } } } }, terminateTimeoutMillis, TimeUnit.MILLISECONDS); } }