Commit bb0df01
committed
desktop: Use
Instead of manually (and unsafely!) fiddling with `Waker` vtables and
implementing our own task "allocator" (a.k.a. the `SlotMap` in `AsyncExecutor`),
rip everything out and use heap-allocated `PlayerRunnable = async_task::Runnable`s
instead.
`async-task` takes care of all the nitty-gritty and provides an API we can directly
plug into the `winit` event loop.
Notes:
- This removes the internal queue of to-be-polled tasks; instead, `PlayerRunnable`s get
pushed as individual winit events directly on the main event loop.
- To prevent polling tasks belonging to stale players, we tag each task with a `PlayerId`
uniquely identifying each `Player` instance, and only poll the task if its ID matches
the active `Player`.async-task crate to manage Player-created futures1 parent 7e7fce6 commit bb0df01
File tree
10 files changed
+107
-381
lines changed- desktop
- src
- frontend-utils
- src
- backends
- executor
10 files changed
+107
-381
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
534 | 534 | | |
535 | 535 | | |
536 | 536 | | |
537 | | - | |
| 537 | + | |
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| |||
| 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 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | 107 | | |
120 | 108 | | |
121 | 109 | | |
| 110 | + | |
122 | 111 | | |
123 | | - | |
124 | 112 | | |
125 | 113 | | |
126 | 114 | | |
| |||
139 | 127 | | |
140 | 128 | | |
141 | 129 | | |
| 130 | + | |
142 | 131 | | |
143 | 132 | | |
144 | 133 | | |
| |||
211 | 200 | | |
212 | 201 | | |
213 | 202 | | |
214 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
215 | 207 | | |
216 | 208 | | |
217 | 209 | | |
| |||
419 | 411 | | |
420 | 412 | | |
421 | 413 | | |
| 414 | + | |
422 | 415 | | |
423 | | - | |
424 | 416 | | |
425 | 417 | | |
426 | 418 | | |
| |||
500 | 492 | | |
501 | 493 | | |
502 | 494 | | |
503 | | - | |
504 | | - | |
505 | | - | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
506 | 503 | | |
507 | 504 | | |
508 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
0 commit comments