diff --git a/platform/core-api/src/com/intellij/openapi/application/NonBlockingReadAction.java b/platform/core-api/src/com/intellij/openapi/application/NonBlockingReadAction.java index 56eb5106a7b6..eb56a72d77a0 100644 --- a/platform/core-api/src/com/intellij/openapi/application/NonBlockingReadAction.java +++ b/platform/core-api/src/com/intellij/openapi/application/NonBlockingReadAction.java @@ -16,6 +16,8 @@ import java.util.function.Consumer; * A utility for running non-blocking read actions in background thread. * "Non-blocking" means to prevent UI freezes, when a write action is about to occur, a read action can be interrupted by a * {@link com.intellij.openapi.progress.ProcessCanceledException} and then restarted. + * + * @see ReadAction#nonBlocking */ public interface NonBlockingReadAction { @@ -25,7 +27,7 @@ public interface NonBlockingReadAction { * are completed. * @see com.intellij.openapi.project.DumbService */ - @Contract(pure=true) + @Contract(pure = true) NonBlockingReadAction inSmartMode(@NotNull Project project); /** @@ -34,21 +36,21 @@ public interface NonBlockingReadAction { * are completed. * @see com.intellij.psi.PsiDocumentManager */ - @Contract(pure=true) + @Contract(pure = true) NonBlockingReadAction withDocumentsCommitted(@NotNull Project project); /** * @return a copy of this builder that cancels submitted read actions after they become obsolete. - * An action is considered obsolete if any of the conditions provided using {@code expireWhen} returns true). - * The conditions are checked inside a read action, either on a background or on the UI thread. + * An action is considered obsolete if any of the conditions provided using {@code expireWhen} returns true). + * The conditions are checked inside a read action, either on a background or on the UI thread. */ - @Contract(pure=true) + @Contract(pure = true) NonBlockingReadAction expireWhen(@NotNull BooleanSupplier expireCondition); /** * @return a copy of this builder that cancels submitted read actions once the specified disposable is disposed. */ - @Contract(pure=true) + @Contract(pure = true) NonBlockingReadAction expireWith(@NotNull Disposable parentDisposable); /** @@ -56,17 +58,17 @@ public interface NonBlockingReadAction { * The read actions are still executed on background thread, but the callbacks on their completion * are invoked on UI thread, and no write action is allowed to interfere before that and possibly invalidate the result. */ - @Contract(pure=true) + @Contract(pure = true) NonBlockingReadAction finishOnUiThread(@NotNull ModalityState modality, @NotNull Consumer uiThreadAction); /** * Submit this computation to be performed in a non-blocking read action on background thread. The returned promise * is completed on the same thread (in the same read action), or on UI thread if {@link #finishOnUiThread} has been called. + * * @param backgroundThreadExecutor an executor to actually run the computation. Common examples are * {@link com.intellij.util.concurrency.NonUrgentExecutor#getInstance()} or * {@link AppExecutorUtil#getAppExecutorService()} or * {@link com.intellij.util.concurrency.BoundedTaskExecutor} on top of that. */ CancellablePromise submit(@NotNull Executor backgroundThreadExecutor); - }