Skip to content

Commit c99704a

Browse files
committed
Remove outdated reactive guide and add section about Reactive Streams to flow.md
1 parent 5378b80 commit c99704a

25 files changed

+14
-1797
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ suspend fun main() = coroutineScope {
6262
* Guides and manuals:
6363
* [Guide to kotlinx.coroutines by example](https://kotlinlang.org/docs/reference/coroutines/coroutines-guide.html) (**read it first**)
6464
* [Guide to UI programming with coroutines](ui/coroutines-guide-ui.md)
65-
* [Guide to reactive streams with coroutines](reactive/coroutines-guide-reactive.md)
6665
* [Debugging capabilities in kotlinx.coroutines](docs/debugging.md)
6766
* [Compatibility policy and experimental annotations](docs/compatibility.md)
6867
* [Change log for kotlinx.coroutines](CHANGES.md)

coroutines-guide.md

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ The main coroutines guide has moved to the [docs folder](docs/coroutines-guide.m
7979
* <a name='upstream-exceptions-only'></a>[Upstream exceptions only](docs/flow.md#upstream-exceptions-only)
8080
* <a name='imperative-versus-declarative'></a>[Imperative versus declarative](docs/flow.md#imperative-versus-declarative)
8181
* <a name='launching-flow'></a>[Launching flow](docs/flow.md#launching-flow)
82+
* <a name='flow-and-reactive-streams'></a>[Flow and Reactive Streams](docs/flow.md#flow-and-reactive-streams)
8283
<!--- TOC_REF docs/channels.md -->
8384
* <a name='channels'></a>[Channels](docs/channels.md#channels)
8485
* <a name='channel-basics'></a>[Channel basics](docs/channels.md#channel-basics)

docs/coroutines-guide.md

-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,5 @@ In order to use coroutines as well as follow the examples in this guide, you nee
2828
## Additional references
2929

3030
* [Guide to UI programming with coroutines](../ui/coroutines-guide-ui.md)
31-
* [Guide to reactive streams with coroutines](../reactive/coroutines-guide-reactive.md)
3231
* [Coroutines design document (KEEP)](https://github.com/Kotlin/kotlin-coroutines/blob/master/kotlin-coroutines-informal.md)
3332
* [Full kotlinx.coroutines API reference](https://kotlin.github.io/kotlinx.coroutines)

docs/flow.md

+13
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class FlowGuideTest {
5858
* [Upstream exceptions only](#upstream-exceptions-only)
5959
* [Imperative versus declarative](#imperative-versus-declarative)
6060
* [Launching flow](#launching-flow)
61+
* [Flow and Reactive Streams](#flow-and-reactive-streams)
6162

6263
<!--- END_TOC -->
6364

@@ -1794,6 +1795,18 @@ as cancellation and structured concurrency serve this purpose.
17941795
Note that [launchIn] also returns a [Job], which can be used to [cancel][Job.cancel] the corresponding flow collection
17951796
coroutine only without cancelling the whole scope or to [join][Job.join] it.
17961797

1798+
### Flow and Reactive Streams
1799+
1800+
For those who are familiar with [Reactive Streams](https://www.reactive-streams.org/) or reactive frameworks such as RxJava and project Reactor,
1801+
design of the Flow may look very familiar.
1802+
1803+
Indeed, its design was inspired by Reactive Streams and its various implementations. But Flow main goal is to have as simple design as possible,
1804+
be Kotlin and suspension friendly and respect structured concurrency. Achieving this goal would be impossible without reactive pioneers and their tremendous work. You can read the complete story in [Reactive Streams and Kotlin Flows](https://medium.com/@elizarov/reactive-streams-and-kotlin-flows-bfd12772cda4) article.
1805+
1806+
While being different, conceptually, Flow *is* a reactive stream and it is possible to convert it to the reactive (spec and TCK compliant) Publisher and vice versa.
1807+
Such converters are provided by `kotlinx.coroutines` out-of-the-box and can be found in corresponding reactive modules (`kotlinx-coroutines-reactive` for Reactive Streams, `kotlinx-coroutines-reactor` for Project Reactor and `kotlinx-coroutines-rx2` for RxJava2).
1808+
Integration modules include conversions from and to `Flow`, integration with Reactor's `Context` and suspension-friendly ways to work with various reactive entities.
1809+
17971810
<!-- stdlib references -->
17981811

17991812
[collections]: https://kotlinlang.org/docs/reference/collections-overview.html

0 commit comments

Comments
 (0)