Skip to content

Commit

Permalink
Fix doc references that differ only in case (function vs interface) (#…
Browse files Browse the repository at this point in the history
…2292)

Fixes #2279
  • Loading branch information
elizarov committed Oct 16, 2020
1 parent 863258b commit eb1b5db
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -29,7 +29,7 @@ suspend fun main() = coroutineScope {
* [delay] and [yield] top-level suspending functions;
* [Flow] — cold asynchronous stream with [flow][_flow] builder and comprehensive operator set ([filter], [map], etc);
* [Channel], [Mutex], and [Semaphore] communication and synchronization primitives;
* [coroutineScope], [supervisorScope], [withContext], and [withTimeout] scope builders;
* [coroutineScope][_coroutineScope], [supervisorScope][_supervisorScope], [withContext], and [withTimeout] scope builders;
* [MainScope()] for Android and UI applications;
* [SupervisorJob()] and [CoroutineExceptionHandler] for supervision of coroutines hierarchies;
* [select] expression support and more.
Expand Down Expand Up @@ -227,8 +227,8 @@ See [Contributing Guidelines](CONTRIBUTING.md).
[Dispatchers.Default]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-dispatchers/-default.html
[delay]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/delay.html
[yield]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/yield.html
[coroutineScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/coroutine-scope.html
[supervisorScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/supervisor-scope.html
[_coroutineScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/coroutine-scope.html
[_supervisorScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/supervisor-scope.html
[withContext]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/with-context.html
[withTimeout]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/with-timeout.html
[MainScope()]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-main-scope.html
Expand Down
12 changes: 6 additions & 6 deletions docs/basics.md
Expand Up @@ -235,12 +235,12 @@ World!
### Scope builder

In addition to the coroutine scope provided by different builders, it is possible to declare your own scope using the
[coroutineScope] builder. It creates a coroutine scope and does not complete until all launched children complete.
[coroutineScope][_coroutineScope] builder. It creates a coroutine scope and does not complete until all launched children complete.

[runBlocking] and [coroutineScope] may look similar because they both wait for their body and all its children to complete.
[runBlocking] and [coroutineScope][_coroutineScope] may look similar because they both wait for their body and all its children to complete.
The main difference is that the [runBlocking] method _blocks_ the current thread for waiting,
while [coroutineScope] just suspends, releasing the underlying thread for other usages.
Because of that difference, [runBlocking] is a regular function and [coroutineScope] is a suspending function.
while [coroutineScope][_coroutineScope] just suspends, releasing the underlying thread for other usages.
Because of that difference, [runBlocking] is a regular function and [coroutineScope][_coroutineScope] is a suspending function.

It can be demonstrated by the following example:

Expand Down Expand Up @@ -281,7 +281,7 @@ Coroutine scope is over
-->

Note that right after the "Task from coroutine scope" message (while waiting for nested launch)
"Task from runBlocking" is executed and printed — even though the [coroutineScope] is not completed yet.
"Task from runBlocking" is executed and printed — even though the [coroutineScope][_coroutineScope] is not completed yet.

### Extract function refactoring

Expand Down Expand Up @@ -403,7 +403,7 @@ Active coroutines that were launched in [GlobalScope] do not keep the process al
[runBlocking]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/run-blocking.html
[Job]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-job/index.html
[Job.join]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-job/join.html
[coroutineScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/coroutine-scope.html
[_coroutineScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/coroutine-scope.html
[CoroutineScope()]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope.html
<!--- END -->

Expand Down
4 changes: 2 additions & 2 deletions docs/composing-suspending-functions.md
Expand Up @@ -308,7 +308,7 @@ concurrency, as shown in the section below.
Let us take the [Concurrent using async](#concurrent-using-async) example and extract a function that
concurrently performs `doSomethingUsefulOne` and `doSomethingUsefulTwo` and returns the sum of their results.
Because the [async] coroutine builder is defined as an extension on [CoroutineScope], we need to have it in the
scope and that is what the [coroutineScope] function provides:
scope and that is what the [coroutineScope][_coroutineScope] function provides:

<div class="sample" markdown="1" theme="idea" data-highlight-only>

Expand Down Expand Up @@ -431,5 +431,5 @@ Computation failed with ArithmeticException
[Job.start]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-job/start.html
[GlobalScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-global-scope/index.html
[CoroutineScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html
[coroutineScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/coroutine-scope.html
[_coroutineScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/coroutine-scope.html
<!--- END -->
10 changes: 5 additions & 5 deletions docs/exception-handling.md
Expand Up @@ -413,9 +413,9 @@ The second child is cancelled because the supervisor was cancelled

#### Supervision scope

Instead of [coroutineScope], we can use [supervisorScope] for _scoped_ concurrency. It propagates the cancellation
Instead of [coroutineScope][_coroutineScope], we can use [supervisorScope][_supervisorScope] for _scoped_ concurrency. It propagates the cancellation
in one direction only and cancels all its children only if it failed itself. It also waits for all children before completion
just like [coroutineScope] does.
just like [coroutineScope][_coroutineScope] does.

<div class="sample" markdown="1" theme="idea" data-highlight-only>

Expand Down Expand Up @@ -464,7 +464,7 @@ Caught an assertion error
Another crucial difference between regular and supervisor jobs is exception handling.
Every child should handle its exceptions by itself via the exception handling mechanism.
This difference comes from the fact that child's failure does not propagate to the parent.
It means that coroutines launched directly inside the [supervisorScope] _do_ use the [CoroutineExceptionHandler]
It means that coroutines launched directly inside the [supervisorScope][_supervisorScope] _do_ use the [CoroutineExceptionHandler]
that is installed in their scope in the same way as root coroutines do
(see the [CoroutineExceptionHandler](#coroutineexceptionhandler) section for details).

Expand Down Expand Up @@ -517,8 +517,8 @@ The scope is completed
[runBlocking]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/run-blocking.html
[SupervisorJob()]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-supervisor-job.html
[Job()]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-job.html
[coroutineScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/coroutine-scope.html
[supervisorScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/supervisor-scope.html
[_coroutineScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/coroutine-scope.html
[_supervisorScope]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/supervisor-scope.html
<!--- INDEX kotlinx.coroutines.channels -->
[actor]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.channels/actor.html
[produce]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.channels/produce.html
Expand Down
8 changes: 4 additions & 4 deletions docs/flow.md
Expand Up @@ -203,7 +203,7 @@ I'm not blocked 3

Notice the following differences in the code with the [Flow] from the earlier examples:

* A builder function for [Flow] type is called [flow].
* A builder function for [Flow] type is called [flow][_flow].
* Code inside the `flow { ... }` builder block can suspend.
* The `simple` function is no longer marked with `suspend` modifier.
* Values are _emitted_ from the flow using [emit][FlowCollector.emit] function.
Expand All @@ -214,7 +214,7 @@ thread is blocked in this case.

### Flows are cold

Flows are _cold_ streams similar to sequences &mdash; the code inside a [flow] builder does not
Flows are _cold_ streams similar to sequences &mdash; the code inside a [flow][_flow] builder does not
run until the flow is collected. This becomes clear in the following example:

<div class="sample" markdown="1" theme="idea" data-min-compiler-version="1.3">
Expand Down Expand Up @@ -1785,7 +1785,7 @@ coroutine only without cancelling the whole scope or to [join][Job.join] it.

### Flow cancellation checks

For convenience, the [flow] builder performs additional [ensureActive] checks for cancellation on each emitted value.
For convenience, the [flow][_flow] builder performs additional [ensureActive] checks for cancellation on each emitted value.
It means that a busy loop emitting from a `flow { ... }` is cancellable:

<div class="sample" markdown="1" theme="idea" data-min-compiler-version="1.3">
Expand Down Expand Up @@ -1944,7 +1944,7 @@ Integration modules include conversions from and to `Flow`, integration with Rea
[CancellationException]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-cancellation-exception/index.html
<!--- INDEX kotlinx.coroutines.flow -->
[Flow]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html
[flow]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/flow.html
[_flow]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/flow.html
[FlowCollector.emit]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow-collector/emit.html
[collect]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/collect.html
[flowOf]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/flow-of.html
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -10,7 +10,7 @@ kotlin_version=1.4.0
# Dependencies
junit_version=4.12
atomicfu_version=0.14.4
knit_version=0.2.0
knit_version=0.2.2
html_version=0.6.8
lincheck_version=2.7.1
dokka_version=0.9.16-rdev-2-mpp-hacks
Expand Down

0 comments on commit eb1b5db

Please sign in to comment.