Commit c6eb817
committed
fix(tonic): make
The boxed `Decoder` inside `Streaming` need not be `Sync` since
hyperium#804. Unfortunately, that makes
`Streaming` non-`Sync`, meaning that all the generated `tonic` futures
cannot be awaited in `Sync` futures.
In fact, the only times we use the `Decoder`, we have a `&mut` unique
reference to it, so we are guaranteed not to require synchronization.
The `sync_wrapper` crate encodes this reasoning, allowing us to safely
make the `Streaming` type `Sync` regardless of whether the contained
`Decoder` is `Sync` or not.Streaming Sync again1 parent 689a86d commit c6eb817
2 files changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
367 | 368 | | |
368 | 369 | | |
369 | 370 | | |
370 | | - | |
371 | | - | |
| 371 | + | |
| 372 | + | |
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
| |||
0 commit comments