(PECL ev >= 0.2.0)
EvSignal::__construct — Construye un objeto watcher EvSignal
$signum
,$callback
,$data
= null
,$priority
= 0
Construye un objeto watcher EvSignal y lo inicia automáticamente. Para un watcher periódico detenido, utilice en su lugar el método EvSignal::createStopped().
signum
Número de la señal. Consulte las constantes exportadas por la extensión
pcntl. Consulte también la página del manual del sistema
signal(7)
.
callback
Consulte las funciones de retrollamada de los Watchers.
data
Datos personalizados para asociar con el watcher.
priority
Ejemplo #1 Gestión de una señal SIGTERM
<?php
$w = new EvSignal(SIGTERM, function ($watcher) {
echo "¡Señal SIGTERM recibida!\n";
$watcher->stop();
});
Ev::run();
?>
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant