Skip to content

Update guide example to better reflect the intent #3292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/topics/coroutine-context-and-dispatchers.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ fun main() = runBlocking<Unit> {
}
delay(500)
request.cancel() // cancel processing of the request
delay(1000) // delay a second to see what happens
println("main: Who has survived request cancellation?")
delay(1000) // delay the main thread for a second to see what happens
//sampleEnd
}
```
Expand All @@ -350,8 +350,8 @@ The output of this code is:
```text
job1: I run in my own Job and execute independently!
job2: I am a child of the request coroutine
job1: I am not affected by cancellation of the request
main: Who has survived request cancellation?
job1: I am not affected by cancellation of the request
```

<!--- TEST -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ fun main() = runBlocking<Unit> {
}
delay(500)
request.cancel() // cancel processing of the request
delay(1000) // delay a second to see what happens
println("main: Who has survived request cancellation?")
delay(1000) // delay the main thread for a second to see what happens
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class DispatcherGuideTest {
test("ExampleContext06") { kotlinx.coroutines.guide.exampleContext06.main() }.verifyLines(
"job1: I run in my own Job and execute independently!",
"job2: I am a child of the request coroutine",
"job1: I am not affected by cancellation of the request",
"main: Who has survived request cancellation?"
"main: Who has survived request cancellation?",
"job1: I am not affected by cancellation of the request"
)
}

Expand Down
Empty file.