private static <T> T getFutureOrCancel(Future<T> future, IProgressMonitor monitor) throws ExecutionException, InterruptedException {
        while (!monitor.isCanceled()) {
            try {
                return future.get(1, TimeUnit.SECONDS);
            } catch (TimeoutException e) {
                // proceed with job cancellation check
            }
        }
        throw new CancellationException();
    }
Dispose job - cancel schedule and remove listeners.
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/semantics/SQLBackgroundParsingJob.java