8000 The 'uv_pipe_connect' not right, expected callback signature actaully passed in reverse · Issue #86 · amphp/ext-uv · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
/ ext-uv Public

The 'uv_pipe_connect' not right, expected callback signature actaully passed in reverse #86

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

Closed
TheTechsTech opened this issue May 7, 2020 · 6 comments

Comments

@TheTechsTech
Copy link
8000 TheTechsTech commented May 7, 2020

The uv_pipe_connect callback coming thru in reverse order, int $status, being pass first, then UVPipe object

The example pipe_bind_connect.php errors on Windows and Linux with:
PHP Warning: uv_write() expects parameter 1 to be UVTcp, UVPipe, integer given in ../examples/uv/pipe_bind_connect.php on line 27

Temporary switching around, the example works as expected.
uv_pipe_connect($b, PIPE_PATH, function($pipe, $status)
to uv_pipe_connect($b, PIPE_PATH, function($status, $pipe)

@ghost
Copy link
ghost commented May 26, 2020

It was changed with commit e76ac0d. Part of the callback signature refactor for v0.3.

@TheTechsTech
Copy link
Author

what's the reasoning for that when everything is still object first? I figure it's a bug, no reason for having status first. The signature for v0.3 show otherwise, callback handle still first.

@ghost
Copy link
ghost commented May 26, 2020

Status first is current pecl state v0.2.4 - the new callback signature with object first affects v0.3.0 (current master, no release).

@TheTechsTech
Copy link
Author

the new callback signature with object first affects v0.3.0 (current master, no release).

What? That is you talking about, that is what is stated, I'm referencing v0.3. I see current master.

https://github.com/bwoebi/php-uv/blob/0b40ad9f512953c1c5c00d9637732891516a703c/php_uv.c#L1518

https://github.com/bwoebi/php-uv/blob/0b40ad9f512953c1c5c00d9637732891516a703c/php_uv.c#L4727

Did you miss I'm referencing the example?
What commit you see the example otherwise?

Have you run the examples then and now?

What commit where uv_pipe_connect or anything where status is first?

@ghost
Copy link
ghost commented May 28, 2020

Any php-uv build previous to commit e76ac0d has the status first, which includes all pecl builds of the extension until to this point (v0.2.4).

Here's a build output of the example, adapted to var_dump the given callback function arguments.

Latest version installed through PECL:

php-uv version: 0.2.4
/home/circleci/project/run_example_pipe_bind.php:21:
array(2) {
  [0] =>
  int(0)
  [1] =>
  class UVPipe#4 (0) {
  }
}

Latest version build from source:

php-uv version: 0.3.0
/home/circleci/project/run_example_pipe_bind.php:21:
array(2) {
  [0] =>
  class UVPipe#4 (0) {
  }
  [1] =>
  int(0)
}

@TheTechsTech
Copy link
Author

I see the example then used function($a,$b), now function($pipe, $status)

TheTechsTech added a commit to symplely/ext-uv that referenced this issue Mar 30, 2023
**In reference to:** amphp#106, amphp#107, amphp#94, amphp#98, amphp#93, amphp#92, amphp#86, amphp#84, amphp#82, amphp#64

- BC signature changes has been revert since some of the tests wasn't changed to match, and too far off original design.
- Using current **Libuv** version or systems installed one, not `pecl`, this setup is not reliant on the really slow `pecl` system for updated installations.

The whole `uv_queue_work()` will need to be re implemented, the core internal `TSRM.c` thread related `tsrm_***_interpreter_context` functions used in PHP 7.4 has been removed since PHP 8.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant
0