Commit fdde694
committed
php#53: Add zend_async_poll_proxy_t for FD resource optimization
Implements a new poll proxy structure that allows multiple consumers
to share a single zend_async_poll_event_t, reducing file descriptor
and libuv handle usage.
Key features:
- zend_async_poll_proxy_t holds reference to shared poll event
- Event aggregation: proxy events are OR'ed into base event
- Reference counting for automatic cleanup
- Standard event interface (start/stop/dispose/callbacks)
Changes:
- Add zend_async_poll_proxy_t structure and typedef
- Add libuv_new_poll_proxy_event() creation function
- Implement proxy start/stop/dispose methods with event aggregation
- Add ZEND_ASYNC_NEW_POLL_PROXY_EVENT() macros
- Update zend_async_reactor_register() signature and calls
- Add zend_async_new_poll_proxy_event_fn function pointer
Usage:
zend_async_poll_event_t *base = ZEND_ASYNC_NEW_POLL_EVENT(fd, 0, events);
zend_async_poll_proxy_t *proxy = ZEND_ASYNC_NEW_POLL_PROXY_EVENT(base, specific_events);
This enables efficient FD sharing while maintaining clean abstraction.1 parent bce124f commit fdde694
File tree
3 files changed
+19
-1
lines changed- Zend
- main/streams
3 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
| 320 | + | |
319 | 321 | | |
320 | 322 | | |
321 | 323 | | |
| |||
350 | 352 | | |
351 | 353 | | |
352 | 354 | | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
| |||
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
| 261 | + | |
| 262 | + | |
260 | 263 | | |
261 | 264 | | |
262 | 265 | | |
| |||
685 | 688 | | |
686 | 689 | | |
687 | 690 | | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
688 | 697 | | |
689 | 698 | | |
690 | 699 | | |
| |||
1361 | 1370 | | |
1362 | 1371 | | |
1363 | 1372 | | |
| 1373 | + | |
1364 | 1374 | | |
1365 | 1375 | | |
1366 | 1376 | | |
| |||
1409 | 1419 | | |
1410 | 1420 | | |
1411 | 1421 | | |
| 1422 | + | |
1412 | 1423 | | |
1413 | 1424 | | |
1414 | 1425 | | |
| |||
1590 | 1601 | | |
1591 | 1602 | | |
1592 | 1603 | | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
1593 | 1608 | | |
1594 | 1609 | | |
1595 | 1610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
570 | | - | |
| 570 | + | |
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
| |||
0 commit comments