void (final @Nullable Consumer<? super Boolean> continuation) { myTaskQueue.run(() -> { final Ref<Boolean> success = new Ref<>(); try { success.set(hasCachesWithEmptiness(false)); } catch (ProcessCanceledException e) { success.set(true); } ApplicationManager.getApplication().invokeLater(() -> continuation.consume(success.get()), myProject.getDisposed()); }); }