Skip to content

Commit 014aa16

Browse files
zsavelyakarnokd
authored andcommitted
Fixed a typo and other cosmetics issues. (#4976)
1 parent 8e3671b commit 014aa16

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ public class HelloWorld {
5757
If your platform doesn't support Java 8 lambdas (yet), you have to create an inner class of `Consumer` manually:
5858

5959
```java
60-
Flowable.just("Hello world")
61-
.subscribe(new Consumer<String>() {
62-
@Override public void accept(String s) {
63-
System.out.println(s);
64-
}
65-
);
60+
Flowable.just("Hello world")
61+
.subscribe(new Consumer<String>() {
62+
@Override public void accept(String s) {
63+
System.out.println(s);
64+
}
65+
);
6666
```
6767

6868
RxJava 2 features several base classes you can discover operators on:
@@ -80,9 +80,9 @@ Flowable.fromCallable(() -> {
8080
Thread.sleep(1000); // imitate expensive computation
8181
return "Done";
8282
})
83-
.subscribeOn(Schedulers.io())
84-
.observeOn(Schedulers.single())
85-
.subscribe(System.out::println, Throwable::printStackTrace);
83+
.subscribeOn(Schedulers.io())
84+
.observeOn(Schedulers.single())
85+
.subscribe(System.out::println, Throwable::printStackTrace);
8686

8787
Thread.sleep(2000); // <--- wait for the flow to finish
8888
```
@@ -95,7 +95,7 @@ Flowable<String> source = Flowable.fromCallable(() -> {
9595
return "Done";
9696
});
9797
98-
Flowabe<String> runBackground = source.subscribeOn(Schedulers.io());
98+
Flowable<String> runBackground = source.subscribeOn(Schedulers.io());
9999
100100
Flowable<String> showForeground = runBackground.observeOn(Schedulers.single());
101101
@@ -114,9 +114,9 @@ Flows in RxJava are sequential in nature split into processing stages that may r
114114
115115
```java
116116
Flowable.range(1, 10)
117-
.observeOn(Schedulers.computation())
118-
.map(v -> v * v)
119-
.blockingSubscribe(System.out::println);
117+
.observeOn(Schedulers.computation())
118+
.map(v -> v * v)
119+
.blockingSubscribe(System.out::println);
120120
```
121121
122122
This example flow squares the numbers from 1 to 10 on the **computation** `Scheduler` and consumes the results on the "main" thread (more precisely, the caller thread of `blockingSubscribe`). However, the lambda `v -> v * v` doesn't run in parallel for this flow; it receives the values 1 to 10 on the same computation thread one after the other.
@@ -125,11 +125,11 @@ Processing the numbers 1 to 10 in parallel is a bit more involved:
125125

126126
```java
127127
Flowable.range(1, 10)
128-
.flatMap(v ->
129-
Flowable.just(v)
130-
.subscribeOn(Schedulers.computation())
131-
.map(v -> v * v)
132-
)
128+
.flatMap(v ->
129+
Flowable.just(v)
130+
.subscribeOn(Schedulers.computation())
131+
.map(v -> v * v)
132+
)
133133
.blockingSubscribe(System.out::println);
134134
```
135135

0 commit comments

Comments
 (0)