File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -210,8 +210,8 @@ link:./src/test/groovy/ch/petikoch/examples/mvvm_rxjava/example6[]
210210
211211link:./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
216216image::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-
226224link:./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+
228238link:./src/test/groovy/ch/petikoch/examples/mvvm_rxjava/example8[]
229239
230240=== Example 9: Structural changes at runtime in the View (and GUI composition)
You can’t perform that action at this time.
0 commit comments