Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dkhalanskyjb committed Dec 10, 2021
2 parents fd8810a + 4724523 commit 3bd4376
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
Binary file modified docs/images/coroutine-breakpoint.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/coroutine-idea-debugging-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/flow-breakpoint.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/flow-build-project.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/flow-debug-project.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/topics/coroutine-context-and-dispatchers.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ The Coroutine Debugger of the Kotlin plugin simplifies debugging coroutines in I
The **Debug** tool window contains the **Coroutines** tab. In this tab, you can find information about both currently running and suspended coroutines.
The coroutines are grouped by the dispatcher they are running on.

![Debugging coroutines](coroutine-idea-debugging-1.png)
![Debugging coroutines](coroutine-idea-debugging-1.png){width=700}

With the coroutine debugger, you can:
* Check the state of each coroutine.
Expand Down
6 changes: 3 additions & 3 deletions docs/topics/debug-coroutines-with-idea.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The tutorial assumes you have prior knowledge of the [coroutines](coroutines-gui

The `src` directory contains Kotlin source files and resources. The `main.kt` file contains sample code that will print `Hello World!`.

2. Change code in the `main()` function:
3. Change code in the `main()` function:

* Use the [`runBlocking()`](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/run-blocking.html) block to wrap a coroutine.
* Use the [`async()`](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/async.html) function to create coroutines that compute deferred values `a` and `b`.
Expand Down Expand Up @@ -61,7 +61,7 @@ The tutorial assumes you have prior knowledge of the [coroutines](coroutines-gui

![Debug the coroutine](coroutine-debug-1.png)

3. Resume the debugger session by clicking **Resume program** in the **Debug** tool window:
3. Resume the debugger session by clicking **Resume Program** in the **Debug** tool window:

![Debug the coroutine](coroutine-debug-2.png)

Expand All @@ -70,7 +70,7 @@ The tutorial assumes you have prior knowledge of the [coroutines](coroutines-gui
* The second coroutine is calculating the `a` value – it has the **RUNNING** status.
* The third coroutine has the **CREATED** status and isn’t calculating the value of `b`.

4. Resume the debugger session by clicking **Resume program** in the **Debug** tool window:
4. Resume the debugger session by clicking **Resume Program** in the **Debug** tool window:

![Build a console application](coroutine-debug-3.png)

Expand Down
14 changes: 7 additions & 7 deletions docs/topics/debug-flow-with-idea.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Create a Kotlin [flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-corou

The `src` directory contains Kotlin source files and resources. The `main.kt` file contains sample code that will print `Hello World!`.

2. Create the `simple()` function that returns a flow of three numbers:
3. Create the `simple()` function that returns a flow of three numbers:

* Use the [`delay()`](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/delay.html) function to imitate CPU-consuming blocking code. It suspends the coroutine for 100 ms without blocking the thread.
* Produce the values in the `for` loop using the [`emit()`](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow-collector/emit.html) function.
Expand All @@ -36,7 +36,7 @@ Create a Kotlin [flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-corou
}
```

3. Change the code in the `main()` function:
4. Change the code in the `main()` function:

* Use the [`runBlocking()`](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/run-blocking.html) block to wrap a coroutine.
* Collect the emitted values using the [`collect()`](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/collect.html) function.
Expand All @@ -53,13 +53,13 @@ Create a Kotlin [flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-corou
}
```

4. Build the code by clicking **Build Project**.
5. Build the code by clicking **Build Project**.

![Build an application](flow-build-project.png)

## Debug the coroutine

1. Set a breakpoint at the at the line where the `emit()` function is called:
1. Set a breakpoint at the line where the `emit()` function is called:

![Build a console application](flow-breakpoint.png)

Expand All @@ -74,7 +74,7 @@ Create a Kotlin [flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-corou

![Debug the coroutine](flow-debug-1.png)

3. Resume the debugger session by clicking **Resume program** in the **Debug** tool window. The program stops at the same breakpoint.
3. Resume the debugger session by clicking **Resume Program** in the **Debug** tool window. The program stops at the same breakpoint.

![Debug the coroutine](flow-resume-debug.png)

Expand All @@ -101,7 +101,7 @@ Create a Kotlin [flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-corou
}
```

4. Build the code by clicking **Build Project**.
3. Build the code by clicking **Build Project**.

## Debug a Kotlin flow with two coroutines

Expand All @@ -117,7 +117,7 @@ Create a Kotlin [flow](https://kotlin.github.io/kotlinx.coroutines/kotlinx-corou
The `buffer()` function buffers emitted values from the flow.
The emitter coroutine has the **RUNNING** status, and the collector coroutine has the **SUSPENDED** status.

2. Resume the debugger session by clicking **Resume program** in the **Debug** tool window.
3. Resume the debugger session by clicking **Resume Program** in the **Debug** tool window.

![Debugging coroutines](flow-debug-4.png)

Expand Down

0 comments on commit 3bd4376

Please sign in to comment.