Move Execution Contexts out of Kotlin Coroutines

This commit is contained in:
Karol Lewandowski 2025-02-18 16:59:44 +01:00 committed by Karol Lewandowski
parent 99c19df3f0
commit 20cef2f8db
6 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!DOCTYPE instance-profile
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">
@ -69,12 +69,12 @@
<toc-element topic="coroutine_scopes.md"/>
<toc-element topic="coroutine_dispatchers.md"/>
<toc-element topic="launching_coroutines.md"/>
<toc-element topic="coroutine_execution_contexts.md"/>
<toc-element topic="coroutine_read_actions.topic"/>
<toc-element topic="coroutine_edt_and_locks.md"/>
<toc-element topic="coroutine_tips_and_tricks.md"/>
<toc-element topic="coroutine_dumps.md"/>
</toc-element>
<toc-element topic="execution_contexts.md" accepts-web-file-names="coroutine-execution-contexts.html"/>
<toc-element topic="background_processes.md"/>
</toc-element>
<toc-element topic="messaging_infrastructure.md"/>

View File

@ -1,4 +1,4 @@
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# Glossary
@ -19,7 +19,7 @@ Annotator
## B
Blocking Context
: Executing in the [blocking context](coroutine_execution_contexts.md#blocking-context) means executing tasks on a thread without access to a coroutine context.
: Executing in the [blocking context](execution_contexts.md#blocking-context) means executing tasks on a thread without access to a coroutine context.
&rarr;&nbsp;_Suspending Context_
&rarr;&nbsp;_Coroutine_
@ -130,7 +130,7 @@ Stubs
: A subset of a &rarr;&nbsp;_Program Structure Interface_ tree in a binary serialized compact format, see [](stub_indexes.md).
Suspending Context
: Executing in the [suspending context](coroutine_execution_contexts.md#suspending-context-coroutines) means executing tasks in Kotlin coroutines.
: Executing in the [suspending context](execution_contexts.md#suspending-context-coroutines) means executing tasks in Kotlin coroutines.
&rarr;&nbsp;_Blocking Context_
&rarr;&nbsp;_Coroutine_

View File

@ -14,7 +14,7 @@ The IntelliJ Platform executes background processes widely and provides two main
> Plugins targeting 2024.1+ should use [Kotlin coroutines](kotlin_coroutines.md), which is a more performant solution and provides the cancellation mechanism out of the box.
>
> See [](coroutine_execution_contexts.md) for coroutine-based APIs to use in different contexts.
> See [](execution_contexts.md) for coroutine-based APIs to use in different contexts.
>
{style="warning" title="Use Kotlin Coroutines"}

View File

@ -1,4 +1,4 @@
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# Coroutines on EDT and Locks
@ -161,7 +161,7 @@ Sometimes it is not desired, as the coroutine in question was scheduled on [`Dis
Anyway, it is suspicious when a read action cannot be executed on a background thread and a part of coroutine code cannot be suspended and rescheduled on EDT.
This may signal a code issue.
Note that this API cannot be used in the [blocking context](coroutine_execution_contexts.md#blocking-context).
Note that this API cannot be used in the [blocking context](execution_contexts.md#blocking-context).
### Suspending `readAndWriteAction()`
@ -176,7 +176,7 @@ Consider rewriting code to use it, if possible.
Use them if a read action is required, but it is unacceptable to reschedule code execution on a different dispatcher.
These APIs are marked to use only in the [blocking context](coroutine_execution_contexts.md#blocking-context), so their usage in the [suspending context](coroutine_execution_contexts.md#suspending-context-coroutines) will trigger a warning.
These APIs are marked to use only in the [blocking context](execution_contexts.md#blocking-context), so their usage in the [suspending context](execution_contexts.md#suspending-context-coroutines) will trigger a warning.
It is intentional, as coroutines should be prepared to be rescheduled and should use `readAction()`.
### Suspending `writeIntentReadAction()` and Blocking `WriteIntentReadAction.run()`/`compute()`

View File

@ -1,4 +1,4 @@
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# Progress Indicators
@ -6,7 +6,7 @@
<tldr>
**Implementation**: Progress tracking in [Progress API](background_processes.md#tracking-progress) and [Kotlin Coroutines](coroutine_execution_contexts.md#progress-reporting)
**Implementation**: Progress tracking in [Progress API](background_processes.md#tracking-progress) and [Kotlin Coroutines](execution_contexts.md#progress-reporting)
</tldr>