From: Chris W. <la...@us...> - 2004-11-28 01:02:26
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14531 Modified Files: Action.pm Log Message: add 'cache hit' observation; add notes about the observations thrown from the common actions Index: Action.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Action.pm,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Action.pm 28 Nov 2004 00:11:52 -0000 1.60 --- Action.pm 28 Nov 2004 01:02:13 -0000 1.61 *************** *** 258,261 **** --- 258,262 ---- my $cached_content = $self->_check_cache; if ( $cached_content ) { + $self->notify_observers( 'cache hit', \$cached_content ); return $cached_content; } *************** *** 1529,1533 **** it requires. The observation is posted just before the content is cached, so if the content is cacheable any modifications will become ! part of the cache. Here is an example: --- 1530,1536 ---- it requires. The observation is posted just before the content is cached, so if the content is cacheable any modifications will become ! part of the cache. (If you need to filter the cached content watch for ! the observation 'cache hit'; it also posts a scalar reference of the ! content.) Here is an example: *************** *** 1554,1558 **** And then map the observer to one or more actions: ! [observer action] wiki = news wiki = page --- 1557,1561 ---- And then map the observer to one or more actions: ! [map] wiki = news wiki = page *************** *** 1571,1578 **** =item B<OpenInteract2::Action::CommonAdd> ! =item B<OpenInteract2::Action::CommonRemove> =item B<OpenInteract2::Action::CommonUpdate> =back --- 1574,1587 ---- =item B<OpenInteract2::Action::CommonAdd> ! Fires: 'pre add' and 'post add' =item B<OpenInteract2::Action::CommonUpdate> + Fires: 'pre update' and 'post update' + + =item B<OpenInteract2::Action::CommonRemove> + + Fires: 'pre remove' and 'post remove' + =back |