diff --git a/topics/basics/architectural_overview/threading/execution_contexts.topic b/topics/basics/architectural_overview/threading/execution_contexts.topic index 897ce2ed2..bc911ce22 100644 --- a/topics/basics/architectural_overview/threading/execution_contexts.topic +++ b/topics/basics/architectural_overview/threading/execution_contexts.topic @@ -5,7 +5,7 @@ xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd" id="execution_contexts" title="Execution Contexts"> - Execution Contexts + Execution Contexts Tracking execution progress, checking for cancellations, and switching between different execution contexts.

The IntelliJ Platform provides APIs that allow tracking the progress of background processes and canceling their @@ -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,16 +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.

    + + + @@ -160,7 +160,7 @@ See Background Processes: Cancellation for - general cancellation mechanism explanation. + general cancellation mechanism explanation. @@ -177,7 +177,7 @@ - + Progress Indicator @@ -218,17 +218,9 @@ - - Progress Indicator - - -
  • - ProgressIndicator.checkCanceled()
  • -
  • - ProgressManager.checkCanceled()
  • -
    - - + + +
    @@ -243,7 +235,7 @@ - - +
    Job Context +
  • ProgressStep - a step-based progress reporting (see its KDoc for details) @@ -275,7 +267,7 @@
  • Progress Indicator ProgressIndicator's @@ -292,37 +284,9 @@ - + + + @@ -330,17 +294,9 @@ 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.

    -