amphp / ext-uv

Other
191 stars 28 forks source link

Unable to get PID of spawned process #71

Closed ghost closed 4 years ago

ghost commented 5 years ago

The current implementation of uv_spawn in php-uv does not allow to get the PID of the newly spawned process. libuv sets the pid in the uv_process_t after calling uv_spawn. php-uv here returns an empty UVProcess class instances (in several other places empty classes are returned too, not limited to fs operations). This makes it impossible to get the PID of the spawned process.

The easiest solution here is to not return an empty class, but use the class and give it some properties.

ghost commented 4 years ago

@bwoebi status?

ghost commented 4 years ago

Another option would be to expose uv_process_get_pid.