@@ -321,8 +321,8 @@ This section covers coroutine cancellation and timeouts.
321321
322322### Cancelling coroutine execution
323323
324- In small application the return from "main" method might sound like a good idea to get all coroutines
325- implicitly terminated. In a larger, long-running application, you need finer-grained control.
324+ In a small application the return from "main" method might sound like a good idea to get all coroutines
325+ implicitly terminated but in a larger, long-running application, you need finer-grained control.
326326The [ launch] function returns a [ Job] that can be used to cancel running coroutine:
327327
328328``` kotlin
@@ -448,7 +448,7 @@ main: Now I can quit.
448448### Closing resources with finally
449449
450450Cancellable suspending functions throw [ CancellationException] on cancellation which can be handled in
451- all the usual way. For example, ` try {...} finally {...} ` expression and Kotlin ` use ` function execute their
451+ the usual way. For example, ` try {...} finally {...} ` expression and Kotlin ` use ` function execute their
452452finalization actions normally when coroutine is cancelled:
453453
454454``` kotlin
@@ -532,7 +532,7 @@ main: Now I can quit.
532532
533533### Timeout
534534
535- The most obvious reason to cancel coroutine execution in practice,
535+ The most obvious reason to cancel coroutine execution in practice
536536is because its execution time has exceeded some timeout.
537537While you can manually track the reference to the corresponding [ Job] and launch a separate coroutine to cancel
538538the tracked one after delay, there is a ready to use [ withTimeout] function that does it.
0 commit comments