diff --git a/topics/basics/architectural_overview/threading/execution_contexts.topic b/topics/basics/architectural_overview/threading/execution_contexts.topic index 9482600e6..897ce2ed2 100644 --- a/topics/basics/architectural_overview/threading/execution_contexts.topic +++ b/topics/basics/architectural_overview/threading/execution_contexts.topic @@ -25,14 +25,14 @@
  • — obsolete since 2024.1
  • -

    Currently, the Progress Indicator context is the most widely used approach in the IntelliJ Platform. +

    Currently, the Progress Indicator context is the most widely used approach in the IntelliJ Platform. As the platform's execution model moves towards coroutines, this approach can be considered obsolete.

    Starting with 2024.2, it is recommended to execute new code in the Job context.

    -

    The following sections explain the contexts and provide information about process cancellation, progress +

    The following sections explain the contexts and provide information about process cancellation, progress tracking, and switching between contexts.

    @@ -80,12 +80,16 @@
  • — obsolete since 2024.1
  • - + +

    Currently, the Progress Indicator context is the most widely used approach in the IntelliJ Platform. + As the platform's execution model moves towards coroutines, this approach + can be considered obsolete.

    Starting with 2024.1, it is recommended to execute new code in the suspending context.

    - +

    The following sections explain the contexts and provide information about process cancellation, progress + tracking, and switching between contexts.

    @@ -173,7 +177,7 @@ - + Progress Indicator @@ -214,7 +218,17 @@ - + + Progress Indicator + + +
  • + ProgressIndicator.checkCanceled()
  • +
  • + ProgressManager.checkCanceled()
  • +
    + + @@ -229,7 +243,7 @@ - - +
    Job Context +
  • ProgressStep - a step-based progress reporting (see its KDoc for details) @@ -261,7 +275,7 @@
  • Progress Indicator ProgressIndicator's @@ -278,7 +292,37 @@ - + @@ -286,7 +330,17 @@ unavailable - + + + +
    Suspending Context + +
  • ProgressStep + - a step-based progress reporting (see its KDoc for details) +
  • +
  • RawProgressReporter + - a raw text, details, and fraction reporting (invoked via reportRawProgress()) +
  • +
    +

    + Any report*Progress() + function must be used inside withBackgroundProgress(), withModalProgress(), + or runWithModalProgressBlocking() from + tasks.kt + . + Otherwise, if there is no reporter in the context, using report*Progress() will + have no effect. + Example: +

    + + withBackgroundProgress(...) { // or other + // ... + reportProgress { reporter -> // or another report*Progress + // do tasks and report progress + } + // ... + } + +
    Blocking Context
    Progress Indicator + ProgressIndicator's + or ProgressManager's + methods +

    See Background Processes: Tracking + Progress for details.

    +