Commit 449cc7b
authored
Replace manual Fiber management with async gem primitives (#2111)
## Problem
We need to run async gem code inside the `each_chunk` function for the
upcoming React on Rails async props implementation. However, this raises
the error:
```
Running scheduler on non-blocking fiber
```
Eliminates manual Fiber.new/yield in streaming architecture, replacing with
Async::Barrier, Async::Queue, and Async::Variable. This enables async gem
code to run inside component streaming without "Running scheduler on
non-blocking fiber" errors.
Key changes:
- Wrapped streaming in Sync blocks for async context
- Replaced @rorp_rendering_fibers with Async::Barrier
- Replaced fiber-based queuing with Async::LimitedQueue
- Implemented concurrent client stream writing (non-blocking)
- Added on_complete callback pattern for cache writes
- Updated all tests to use async primitives1 parent 79e334c commit 449cc7b
File tree
4 files changed
+181
-125
lines changed- react_on_rails_pro
- app/helpers
- lib/react_on_rails_pro/concerns
- spec
- dummy/spec/helpers
- react_on_rails_pro
4 files changed
+181
-125
lines changedLines changed: 59 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
132 | 136 | | |
133 | 137 | | |
134 | 138 | | |
| |||
185 | 189 | | |
186 | 190 | | |
187 | 191 | | |
188 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
189 | 197 | | |
190 | 198 | | |
191 | 199 | | |
| |||
246 | 254 | | |
247 | 255 | | |
248 | 256 | | |
249 | | - | |
250 | | - | |
251 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
252 | 261 | | |
253 | | - | |
| 262 | + | |
| 263 | + | |
254 | 264 | | |
255 | 265 | | |
256 | 266 | | |
257 | 267 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
273 | 280 | | |
274 | 281 | | |
275 | 282 | | |
| |||
291 | 298 | | |
292 | 299 | | |
293 | 300 | | |
294 | | - | |
295 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
296 | 305 | | |
297 | 306 | | |
298 | 307 | | |
299 | 308 | | |
300 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
301 | 315 | | |
| 316 | + | |
| 317 | + | |
302 | 318 | | |
303 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
304 | 329 | | |
305 | | - | |
306 | 330 | | |
307 | | - | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
308 | 337 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
313 | 341 | | |
314 | 342 | | |
315 | 343 | | |
| |||
Lines changed: 32 additions & 51 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | 34 | | |
| 35 | + | |
52 | 36 | | |
53 | 37 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
58 | 41 | | |
59 | | - | |
| 42 | + | |
60 | 43 | | |
61 | | - | |
62 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
63 | 50 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | 51 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
73 | 57 | | |
74 | 58 | | |
75 | 59 | | |
76 | 60 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 61 | + | |
83 | 62 | | |
84 | | - | |
85 | | - | |
86 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
87 | 68 | | |
88 | 69 | | |
89 | | - | |
90 | 70 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
100 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
101 | 82 | | |
102 | 83 | | |
103 | 84 | | |
0 commit comments