In 2018, I wrote an extension called Excimer, and we've been using it
internally in WMF since then.

Today, someone from outside WMF discovered the extension and reminded
us that we never published on PECL. That's a good point -- when I
wrote it I assumed it would be generally useful and appreciated, I
just never got around to promoting it.

PHP 7.1 introduced the EG(vm_interrupt) feature, to improve signal
handling. Excimer provides generic timers which use EG(vm_interrupt)
to run arbitrary userspace callbacks after a certain time has elapsed.
For example:

$timer = new ExcimerTimer;
$timer->setInterval( 10 /* seconds */ );
$timer->setCallback( function () {
    throw new Exception( "The allowed time has been exceeded" );
} );
$timer->start();
do_expensive_thing();

It provides one-shot timers, peroidic timers, and a sampling profiler
backend which aggregates stack traces for userspace formatting. For
more information, see https://www.mediawiki.org/wiki/Excimer

So we'd like to put Excimer into PECL. Also, I'd like Timo Tijhof
(krinkle) to be given a PECL account so that I'm not a SPOF for this
extension.

If people like this extension, perhaps we could also write a manual
chapter for it, like we did with LuaSandbox.

-- Tim Starling

-- 
PECL development discussion Mailing List (https://pecl.php.net/)
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to