-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDE documentation/stubs, updated and added examples mainly for Windows usage. #77
base: master
Are you sure you want to change the base?
Conversation
Docblocks from readme, http://docs.libuv.org/en/v1.x/index.html, and https://github.com/thlorenz/libuv-dox
Hey, cool that you're working on it - see it's WIP, but just a quick note at a first glance: https://github.com/bwoebi/php-uv/blob/master/php_uv.c#L2626-L2676 is defining a lot of UV* named classes. There are no resourced returned by uv_* functions, only properly typed objects. And the functions are operating on these objects then. (You can compare that with the code, where it's using UV_PARAM_OBJ() with the appropriate class reference. The README is a little outdated in that regard... Thanks for working on it! |
FYI: There are already uv stubs in PhpStorm. However these are wrong, since they say the functions return resources. cc @WyriHaximus |
@bwoebi, As things currently stand, the readme show @CharlotteDunois, My searching did not reveal PhpStorm stubs, otherwise might have not even started this, anyway it does not really document or as informative as what's listed on libuv.org website. |
@CharlotteDunois FYI I took the readme of this extension as the source for those stubs |
@WyriHaximus That's what I figured. But that doesn't make it correct. :D @techno-express You should not think that libuv is a replacement for parallel. While libuv offers queueing work for a separate thread, there is no special handling being taken care of. I would not be surprised if specific things would simply segfault. Parallel is explicitely made for parallelism in PHP and takes special care of everything. If you need parallelism in PHP, use parallel and not the threading work API of libuv. |
@CharlotteDunois, maybe you can add some long overdue examples to Parallel repo. From my programming background/schooling, I look at everything from an computer science perspective. It's just the concepts to me, and whether does it produce the results. What is Parallel trying to achieve, how is it accomplish, how much effort is needed to get there, when is it needed? Anyway, I did leave some comments there, krakjoe/parallel#59, krakjoe/parallel#25. I read Parallel documentation, it's more wrapped up in the terminology from what I see, and that can be simply matched to what's presented in libuv. There are workarounds to everything, it's just the developers responsibility to find it. Take the uv_spawn() example rewrite it using Parallel, much more work. Parallel or parallelism have very limited uses, and can currently be accomplished using no external or third party extension. |
@CharlotteDunois agreed, I trusted the readme here to be correct. Maybe we can generate the stubs and readme from the ext source code to make them correct |
…, psr-2 fixes The `poll.php` example errors with PHP Warning: fclose() expects parameter 1 to be resource, boolean given The `tcp_bind.php` example does not work as expected, waits for a separate connect then does first parts and exit The `spawn.php` example has the passed in environment array off by 1 on display
…ils on windows the `pipe.php` example errors with PHP Warning: uv_pipe_open(): invalid argument in It seems all examples network relate stuff fails on windows. uv_fs_write, uv_write, both return false and negative status number
…mainly for windows
I've updated the inline proto stubs within php_uv.c: e76ac0d (i.e. grep for These should reflect the current state accurately. And also directly mirror the callable signatures. Now the stubs could be updated to be really correct. |
I see, I believed I already had those types added. Look over whenever, I think i have most things covered. Unless you have some corrections I need to be make, I'm mostly finish, some stuff mostly Windows I wanted to actually tests to report on. |
At a quick glance it's not too bad, but there are still more than 10 signatures which still need improvement. I can check them out though in the next week. |
- update `uv_spawn` callback to just close all handles - renamed function, allow to return results - update readme about integration - updated/added channnel class method to send kill to subprocess - keep `libuv` doc/stubs in sync with [WIP] PR amphp/ext-uv#77
… only when result - `triggerSuccess` should handle actual returned values, no last output - keep `libuv` doc/stubs in sync with [WIP] PR amphp/ext-uv#77
Hi, is there any news ? If you need help to finish this pull request, it would be a pleasure |
I figure it's mostly done, when started it was focused on the previous ext-uv version, might need double checking on some callback signature changes. |
@techno-express so you need some times to finish this pull request ? Or do you wait for @bwoebi to review ? |
No, the PR is finish, needs review and not up to me to merge. |
signals
under windowsuv_spawn
poll_sendfile.php
, which reveal some functionality under windows not working,uv_fs_sendfile
,uv_fs_write
, anduv_write
sending/writing to any uvstream/socket/fd
client resource fails inpipe_bind_connect.php
,pipe.php
,poll.php
, andtcp_bind.php