Commit bc814fb
committed
wip implement pattern
TODO next up: we need to also keep alive things that we're depending on
in order to be delivered events — or are we doing this already just by
keeping the channel around which thus keeps objects around?
TODO next up write some tests
Note that we have been able to remove the "keep channel alive" code from
integration tests now (TODO I still don't understand why the channel
would have been dying before; wouldn't the realtime instance have kept
it around? Ah, no — I think that we could have probably even removed it
in the previous PR, because the tests have a reference to the realtime
instance)
TODO make sure that we're only passing what's necessary dependency-wise;
there might be some leftovers
TODO make sure that we document what you need to not hold a strong
reference to
TODO note that we can keep our own objects and the channel alive for as long as we want
given the public API, but then we're stuck after that — i.e. if keeping
the channel alive doesn't keep the connection alive (not sure if it
does) then there's not a whole lot we can do
TODO address the stuff we did internally (keeping a reference to the
public type)
TODO remove the "default implementation" stuff
TODO documentation
TODO note that there are no weak references inside the codebase at the
moment, if we need them we'll add them
explain that the public classes are boring and that they just pass
dependencies and map to public
note that we get away with not passing CoreSDK because it's actually
barely used (just for checking channel state so far)
it's nice to in general not have to worry whether various properties are
nil or not — that said, I guess the worry is that it's easier to
accidentally capture something strongly, we'll have to think about what
to do there
maybe conflating channel and plugin into a single type was a mistake,
because it'll get in the way whenever we want to do something
non-channel related
Asked Cursor to fix the tests for me — TODO check
TODO umm but how is this going to work when we need to send something
ove the channel? I feel like I've missed something important here? ah,
no — if you want to publish, then the public will give you the CoreSDK
that you need1 parent 836f502 commit bc814fb
21 files changed
Lines changed: 915 additions & 513 deletions
File tree
- Sources/AblyLiveObjects
- Internal
- Public
- Public Proxy Objects
- Utility
- Tests/AblyLiveObjectsTests
- Helpers
- JS Integration Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
70 | 69 | | |
71 | 70 | | |
72 | 71 | | |
73 | | - | |
74 | | - | |
| 72 | + | |
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
78 | 76 | | |
79 | | - | |
| 77 | + | |
80 | 78 | | |
81 | 79 | | |
82 | 80 | | |
| |||
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
92 | | - | |
| 90 | + | |
93 | 91 | | |
94 | 92 | | |
95 | 93 | | |
| |||
159 | 157 | | |
160 | 158 | | |
161 | 159 | | |
162 | | - | |
163 | | - | |
164 | 160 | | |
165 | 161 | | |
166 | 162 | | |
| |||
176 | 172 | | |
177 | 173 | | |
178 | 174 | | |
179 | | - | |
180 | | - | |
181 | 175 | | |
182 | 176 | | |
183 | 177 | | |
| |||
194 | 188 | | |
195 | 189 | | |
196 | 190 | | |
197 | | - | |
198 | | - | |
199 | 191 | | |
200 | 192 | | |
201 | 193 | | |
202 | 194 | | |
203 | 195 | | |
204 | 196 | | |
205 | 197 | | |
206 | | - | |
| 198 | + | |
207 | 199 | | |
208 | | - | |
| 200 | + | |
209 | 201 | | |
210 | 202 | | |
211 | 203 | | |
212 | 204 | | |
213 | 205 | | |
214 | 206 | | |
215 | | - | |
| 207 | + | |
216 | 208 | | |
217 | 209 | | |
218 | 210 | | |
| |||
241 | 233 | | |
242 | 234 | | |
243 | 235 | | |
244 | | - | |
245 | | - | |
246 | 236 | | |
247 | 237 | | |
248 | 238 | | |
| |||
255 | 245 | | |
256 | 246 | | |
257 | 247 | | |
258 | | - | |
| 248 | + | |
259 | 249 | | |
260 | 250 | | |
261 | 251 | | |
| |||
270 | 260 | | |
271 | 261 | | |
272 | 262 | | |
273 | | - | |
274 | | - | |
275 | 263 | | |
276 | 264 | | |
277 | 265 | | |
| |||
326 | 314 | | |
327 | 315 | | |
328 | 316 | | |
329 | | - | |
330 | | - | |
331 | 317 | | |
332 | 318 | | |
333 | 319 | | |
| |||
338 | 324 | | |
339 | 325 | | |
340 | 326 | | |
341 | | - | |
342 | | - | |
343 | 327 | | |
344 | 328 | | |
345 | 329 | | |
| |||
356 | 340 | | |
357 | 341 | | |
358 | 342 | | |
359 | | - | |
360 | | - | |
361 | 343 | | |
362 | 344 | | |
363 | 345 | | |
| |||
375 | 357 | | |
376 | 358 | | |
377 | 359 | | |
378 | | - | |
379 | | - | |
380 | 360 | | |
381 | 361 | | |
382 | 362 | | |
| |||
386 | 366 | | |
387 | 367 | | |
388 | 368 | | |
389 | | - | |
390 | | - | |
391 | 369 | | |
392 | 370 | | |
393 | 371 | | |
| |||
402 | 380 | | |
403 | 381 | | |
404 | 382 | | |
405 | | - | |
406 | | - | |
407 | 383 | | |
408 | 384 | | |
409 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
| 22 | + | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 26 | | |
39 | 27 | | |
40 | 28 | | |
| |||
Lines changed: 2 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 20 | | |
29 | 21 | | |
30 | 22 | | |
31 | | - | |
| 23 | + | |
32 | 24 | | |
33 | 25 | | |
34 | 26 | | |
| |||
45 | 37 | | |
46 | 38 | | |
47 | 39 | | |
48 | | - | |
49 | | - | |
| 40 | + | |
50 | 41 | | |
51 | 42 | | |
52 | 43 | | |
| |||
Lines changed: 15 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
38 | | - | |
39 | 37 | | |
40 | 38 | | |
41 | | - | |
| 39 | + | |
42 | 40 | | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | | - | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
51 | | - | |
52 | 48 | | |
53 | 49 | | |
54 | 50 | | |
| |||
58 | 54 | | |
59 | 55 | | |
60 | 56 | | |
61 | | - | |
62 | 57 | | |
63 | 58 | | |
64 | 59 | | |
65 | 60 | | |
66 | 61 | | |
67 | | - | |
68 | 62 | | |
69 | 63 | | |
70 | 64 | | |
71 | 65 | | |
72 | 66 | | |
73 | 67 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
85 | 78 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
90 | 82 | | |
91 | 83 | | |
92 | 84 | | |
| |||
0 commit comments