This repository was archived by the owner on Aug 17, 2020. It is now read-only.
Commit e6c781a
committed
Guard against a slow scheduler with backpressure strategy.
Schedulers apply backpressure upstream which previously behaved as an unbounded stream. When the scheduler worker couldn't keep up an MBPE was thrown. We already use the 'latest' strategy for slowing 'Query' emissions after the scheduler so we can apply the same thing before it.
This comes with a subtle change in that transactions will now synchronously run every filter Func before continuing. Previously the filters ran on the scheduler and did not block the thread performing the transaction. This means that the more queries that are listening at once, the slower every transaction's completing step will be. I don't expect this to have any meaningful impact since it's very fast and happening on a background thread already.1 parent 815b3ac commit e6c781a
4 files changed
Lines changed: 55 additions & 12 deletions
File tree
- sqlbrite/src
- androidTest/java/com/squareup/sqlbrite
- main/java/com/squareup/sqlbrite
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
173 | 194 | | |
174 | 195 | | |
175 | 196 | | |
| |||
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
744 | 745 | | |
745 | 746 | | |
746 | 747 | | |
747 | | - | |
| 748 | + | |
748 | 749 | | |
749 | 750 | | |
750 | 751 | | |
| |||
789 | 790 | | |
790 | 791 | | |
791 | 792 | | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
792 | 817 | | |
793 | 818 | | |
794 | 819 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | | - | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
Lines changed: 5 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
| |||
247 | 245 | | |
248 | 246 | | |
249 | 247 | | |
250 | | - | |
| 248 | + | |
251 | 249 | | |
252 | 250 | | |
253 | 251 | | |
| |||
268 | 266 | | |
269 | 267 | | |
270 | 268 | | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | 269 | | |
275 | 270 | | |
276 | 271 | | |
| |||
318 | 313 | | |
319 | 314 | | |
320 | 315 | | |
321 | | - | |
322 | | - | |
323 | 316 | | |
324 | 317 | | |
325 | 318 | | |
326 | 319 | | |
327 | 320 | | |
328 | 321 | | |
329 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
330 | 326 | | |
331 | 327 | | |
332 | 328 | | |
| |||
0 commit comments