Update coroutines-guide.md
This tutorial suggests just Async suffix:
https://github.com/Kotlin/kotlin-coroutines/blob/master/kotlin-coroutines-informal.md#asynchronous-programming-styles
Also, there was "of" instead of "or"
diff --git a/core/kotlinx-coroutines-core/src/test/kotlin/guide/example-compose-04.kt b/core/kotlinx-coroutines-core/src/test/kotlin/guide/example-compose-04.kt
index 144eb9f..4161bdd 100644
--- a/core/kotlinx-coroutines-core/src/test/kotlin/guide/example-compose-04.kt
+++ b/core/kotlinx-coroutines-core/src/test/kotlin/guide/example-compose-04.kt
@@ -30,13 +30,13 @@
return 29
}
-// The result type of asyncSomethingUsefulOne is Deferred<Int>
-fun asyncSomethingUsefulOne() = async {
+// The result type of somethingUsefulOneAsync is Deferred<Int>
+fun somethingUsefulOneAsync() = async {
doSomethingUsefulOne()
}
-// The result type of asyncSomethingUsefulTwo is Deferred<Int>
-fun asyncSomethingUsefulTwo() = async {
+// The result type of somethingUsefulTwoAsync is Deferred<Int>
+fun somethingUsefulTwoAsync() = async {
doSomethingUsefulTwo()
}
@@ -44,8 +44,8 @@
fun main(args: Array<String>) {
val time = measureTimeMillis {
// we can initiate async actions outside of a coroutine
- val one = asyncSomethingUsefulOne()
- val two = asyncSomethingUsefulTwo()
+ val one = somethingUsefulOneAsync()
+ val two = somethingUsefulTwoAsync()
// but waiting for a result must involve either suspending or blocking.
// here we use `runBlocking { ... }` to block the main thread while waiting for the result
runBlocking {
diff --git a/coroutines-guide.md b/coroutines-guide.md
index 35ceb50..59b86b8 100644
--- a/coroutines-guide.md
+++ b/coroutines-guide.md
@@ -741,22 +741,22 @@
We can define async-style functions that invoke `doSomethingUsefulOne` and `doSomethingUsefulTwo`
_asynchronously_ using [async] coroutine builder. It is a good style to name such functions with
-either "async" prefix of "Async" suffix to highlight the fact that they only start asynchronous
-computation and one needs to use the resulting deferred value to get the result.
+"Async" suffix to highlight the fact that they only start asynchronous computation and one needs
+to use the resulting deferred value to get the result.
```kotlin
-// The result type of asyncSomethingUsefulOne is Deferred<Int>
-fun asyncSomethingUsefulOne() = async {
+// The result type of somethingUsefulOneAsync is Deferred<Int>
+fun somethingUsefulOneAsync() = async {
doSomethingUsefulOne()
}
-// The result type of asyncSomethingUsefulTwo is Deferred<Int>
-fun asyncSomethingUsefulTwo() = async {
+// The result type of somethingUsefulTwoAsync is Deferred<Int>
+fun somethingUsefulTwoAsync() = async {
doSomethingUsefulTwo()
}
```
-Note, that these `asyncXXX` function are **not** _suspending_ functions. They can be used from anywhere.
+Note, that these `xxxAsync` functions are **not** _suspending_ functions. They can be used from anywhere.
However, their use always implies asynchronous (here meaning _concurrent_) execution of their action
with the invoking code.
@@ -767,8 +767,8 @@
fun main(args: Array<String>) {
val time = measureTimeMillis {
// we can initiate async actions outside of a coroutine
- val one = asyncSomethingUsefulOne()
- val two = asyncSomethingUsefulTwo()
+ val one = somethingUsefulOneAsync()
+ val two = somethingUsefulTwoAsync()
// but waiting for a result must involve either suspending or blocking.
// here we use `runBlocking { ... }` to block the main thread while waiting for the result
runBlocking {