Commit e050d63
Clément Le Provost
Add an option to choose a custom queue for completion handlers (#334)
* [refact] Rename queues
This should make the code a tad more readable.
* Add an option to choose a custom queue for completion handlers
This required quite a bit of refactoring:
- Eliminate all explicit references to the main dispatch queue and the main operation queue. This required creating a dedicated queue for aggregate operations (like “delete by query”), called `inMemoryQueue`.
- Serialize the fallback logic in mixed online/offline requests. Since the completion queue can be parallel, this is required now.
NOTE: I chose to expose an `OperationQueue` instead of a `DispatchQueue` because (as of iOS 8.0) you can wrap a dispatch queue inside an operation queue (using `underlyingQueue`) whereas the opposite is not true.
Fixes #69.1 parent 08e0fa6 commit e050d63
File tree
9 files changed
+167
-99
lines changed- Source
- Offline
- Tests
9 files changed
+167
-99
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
193 | 201 | | |
194 | | - | |
195 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
196 | 211 | | |
197 | 212 | | |
198 | 213 | | |
| |||
234 | 249 | | |
235 | 250 | | |
236 | 251 | | |
237 | | - | |
238 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
239 | 255 | | |
240 | 256 | | |
241 | 257 | | |
| |||
333 | 349 | | |
334 | 350 | | |
335 | 351 | | |
336 | | - | |
| 352 | + | |
337 | 353 | | |
338 | 354 | | |
339 | 355 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
123 | 128 | | |
| 129 | + | |
124 | 130 | | |
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
131 | | - | |
| 137 | + | |
132 | 138 | | |
133 | 139 | | |
134 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
| |||
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| 80 | + | |
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
335 | 334 | | |
336 | 335 | | |
337 | 336 | | |
338 | 337 | | |
339 | | - | |
| 338 | + | |
340 | 339 | | |
341 | 340 | | |
342 | 341 | | |
| |||
487 | 486 | | |
488 | 487 | | |
489 | 488 | | |
490 | | - | |
| 489 | + | |
491 | 490 | | |
492 | 491 | | |
493 | 492 | | |
| |||
553 | 552 | | |
554 | 553 | | |
555 | 554 | | |
556 | | - | |
| 555 | + | |
557 | 556 | | |
558 | 557 | | |
559 | 558 | | |
| |||
0 commit comments