Skip to content

Commit 5d457a5

Browse files
committed
docz
1 parent 5081e60 commit 5d457a5

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

README.adoc

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ link:./src/test/groovy/ch/petikoch/examples/mvvm_rxjava/example6[]
210210

211211
link:./src/main/java/ch/petikoch/examples/mvvm_rxjava/example7[]
212212

213-
* The model publishes `LogRow`s (computational thread)
214-
* These are added in the view as rows of a `JTable` (swing thread)
213+
* The model publishes `LogRow` s (using a computational thread)
214+
* These are added in the view as rows of a `JTable` (using GUI thread)
215215

216216
image::example7.png[]
217217

@@ -221,10 +221,20 @@ link:./src/test/groovy/ch/petikoch/examples/mvvm_rxjava/example7[]
221221

222222
=== Example 8: Log table with LogRow's pushed up from the Model and dealing with backpressure
223223

224-
TODO
225-
226224
link:./src/main/java/ch/petikoch/examples/mvvm_rxjava/example8[]
227225

226+
* The model uses a threadpool to create plenty of `LogRow` s (using as many threads as there are CPU cores)
227+
* Since the view runs on a single thread, it can't keep up with the pace
228+
** "Fast producer, slow consumer" kind of problem
229+
* We need to think about backpressure
230+
** We could slow down the `LogRow` production (blocking backpressure)
231+
** Or we could drop the ones which are "too much", keep up "full speed" and show only some of the `LogRow` s
232+
** The example uses dropping
233+
234+
image::example8.png[]
235+
236+
Tests:
237+
228238
link:./src/test/groovy/ch/petikoch/examples/mvvm_rxjava/example8[]
229239

230240
=== Example 9: Structural changes at runtime in the View (and GUI composition)

docs/example8.png

324 KB
Loading

0 commit comments

Comments
 (0)