posix_getpid
reactphp/event-loop
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return the current process identifier
posix_getpid
():
int
});
$this
->
loop
->
futureTick
(function () {
posix_kill
(
posix_getpid
(),
SIGUSR1
);
});
$this
->
loop
->
run
();
tests/AbstractLoopTest.php
$this
->
loop
->
addSignal
(
SIGUSR1
,
$func
);
$this
->
loop
->
addTimer
(
0.4
, function () {
posix_kill
(
posix_getpid
(),
SIGUSR1
);
});
$loop
=
$this
->
loop
;
$this
->
loop
->
addTimer
(
0.9
, function () use (&
$func
,
$loop
) {
tests/AbstractLoopTest.php
protected function
forkSendSignal
(
$signal
)
{
$currentPid
=
posix_getpid
();
$childPid
=
pcntl_fork
();
if (
$childPid
== -
1
) {
$this
->
fail
(
"Failed to fork child process!"
);
tests/StreamSelectLoopTest.php