Re: [PHP-PEAR] event-based oop design
[email protected] ("Jesus M. Castagnetto") Wed, 14 Mar 2001 19:36:07 -0800 (PST)
| Newsgroups | php.pear |
|---|---|
| Message-ID | <[email protected]> |
Cool thing Stig, --- Stig Sæther Bakken <[email protected]> wrote: > Hi Jesus, > > PHP has a feature called "ticks" that lets you do > cooperative > multitasking in a PHP request. A tick is a callback > from Zend for > every N statements processed. Example: > > <?php > > function tick($arg) { > print "[tick, arg=$arg]\n"; > } > > register_tick_function("tick", 42); > > // these statements are not "ticked": > 1;1;1;1; > > declare (ticks = 1) { > // these statements are "ticked": > 1;1;1;1; > } > > ?> I did not see that in the code, but then again, I had not looked at it since last November. This could really be a nice thing to document, although I can see it can be abused or be a nice code-bomb. Anyone has strong opinions against documenting this in the manual? > You could use this to implement polling of an "event > bus", Hey! we can put this into PEAR/Experimental so we can have event based caching of info, etc.! And then we can have a master script/class the can destroy old copies running, and then... (just kidding, just kidding) > but if you > implement that in PHP you'll come back as a toad in > your next > life. ;-) Crooooak! Crooooak! Crooooak! (plop!) ===== --- Jesus M. Castagnetto ([email protected]) __________________________________________________ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.yahoo.com/