« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 3 of about 3 for eventSighandler (0.004 sec.)
Constructing signal events | PHP 8.3 11068
Constructing signal events Event can also watch for POSIX-style signals. To construct a handler for a signal, use Event::__construct() constructor with Event::SIGNAL flag, or Event::signal() factory method. 例1 Handling SIGTERM signal <?php ... function __construct ( $base ) { $this -> base = $base ; $this -> ev = Event :: signal ( $base , SIGTERM , array( $this , 'eventSighandler' )); $this -> ev -> add (); } public function eventSighandler ( $no , $c ) { echo "Caught signal $no \n" ; $this -> base - ...
https://man.mtool.work/php/8.3/event.constructing.signal.events.html
Event::add — Makes event pending | PHP 8.3 10101
Event::add (PECL event >= 1.2.6-beta) Event::add — Makes event pending 説明 public function Event::add ( float $timeout = ? ): bool Marks event pending. Non-pending event will never occur, and the event callback will never be called. In con ... function __construct ( $base ) { $this -> base = $base ; $this -> ev = Event :: signal ( $base , SIGTERM , array( $this , 'eventSighandler' )); $this -> ev -> add (); } public function eventSighandler ( $no , $c ) { echo "Caught signal $no \n" ; $this -> base - ...
https://man.mtool.work/php/8.3/event.add.html
例 | PHP 8.3 6715
例 例1 Simple HTTP client <?php // Read callback function readcb ( $bev , $base ) { //$input = $bev->input; //$bev->getInput(); //$pos = $input->search("TTP"); $pos = $bev -> input -> search ( "TTP" ); while (( $n = $bev -> input -> remove ... ght signal 15 */ class MyEventSignal { private $base ; function __construct ( $base ) { $this -> base = $base ; } function eventSighandler ( $no , $c ) { echo "Caught signal $no \n" ; event_base_loopexit ( $c -> base ); } } $base = event_base_new (); $c = new M ... yEventSignal ( $base ); $no = SIGTERM ; $ev = evsignal_new ( $base , $no , array( $c , 'eventSighandler' ), $c ); evsignal_add ( $ev ); event_base_loop ( $base ); ?> 例6 Use libevent's loop to process requests of `eio' extensi ...
https://man.mtool.work/php/8.3/event.examples.html
PREV 1 NEXT