@@ -333,8 +333,8 @@ This section covers coroutine cancellation and timeouts.
333333
334334### Cancelling coroutine execution
335335
336- In small application the return from "main" method might sound like a good idea to get all coroutines
337- implicitly terminated. In a larger, long-running application, you need finer-grained control.
336+ In a small application the return from "main" method might sound like a good idea to get all coroutines
337+ implicitly terminated but in a larger, long-running application, you need finer-grained control.
338338The [ launch] function returns a [ Job] that can be used to cancel running coroutine:
339339
340340``` kotlin
@@ -460,7 +460,7 @@ main: Now I can quit.
460460### Closing resources with finally
461461
462462Cancellable suspending functions throw [ CancellationException] on cancellation which can be handled in
463- all the usual way. For example, ` try {...} finally {...} ` expression and Kotlin ` use ` function execute their
463+ the usual way. For example, ` try {...} finally {...} ` expression and Kotlin ` use ` function execute their
464464finalization actions normally when coroutine is cancelled:
465465
466466``` kotlin
@@ -544,7 +544,7 @@ main: Now I can quit.
544544
545545### Timeout
546546
547- The most obvious reason to cancel coroutine execution in practice,
547+ The most obvious reason to cancel coroutine execution in practice
548548is because its execution time has exceeded some timeout.
549549While you can manually track the reference to the corresponding [ Job] and launch a separate coroutine to cancel
550550the tracked one after delay, there is a ready to use [ withTimeout] function that does it.
0 commit comments