--- parser3/tests/160.html 2007/03/27 08:38:34 1.1 +++ parser3/tests/160.html 2007/08/06 16:48:33 1.3 @@ -1,26 +1,108 @@ @main[] -^do[One] -^sleep(1) -^do[Two] +$sDir[outputs/160] +$iStep(1) +$iSleepTime(3) +$iCacheTime(2) + + + + + + + + + + + -@do[sText][i] -
-^for[i](1;3){ - $iCacheTime[] - ^cache[outputs/160.cache](1){ - =$sText= - ^if($sText eq "Two"){ - ^cache(0) - } - $iCacheTime(^cache[]) - } - ^if(def $iCacheTime){ - Execute code, ^^cache[] == ^iCacheTime.int(0) + + + + + + + +# wait till cache expire + + + + + + + + + + + + + + +
File: 1File: 2File: 3
+ ^do[1](3){One} + + ^do[2](3){Two} + + ^do[3](3){Three} +


+^do[3](3){ + ^method[] +}{ + $exception.handled(1) + ^cache(2) + Error occure while executing body +} +
+^sleep($iSleepTime) +^^sleep($iSleepTime) +
+^do[1](3){ + ^method[] +}{ + ^cache(1) + $exception.handled[cache] + Error occure while executing body but force get cached resuls +} + +^do[2](3){ + Two + ^cache(0) +} + +^do[3](3){ + ^method[] +}{ + $exception.handled(1) + ^cache(0) + Error occure while executing body +} +
+ + +@do[sFile;iSteps;jBody;jExceptionHandler][i;bProcessBody;bProcessErrorHandler;iTime;sBody] +^for[i](1;$iSteps){ + $iTime[] + $bProcessBody(0) + $bProcessErrorHandler(0) + + $sBody[^cache[$sDir/$sFile]($iCacheTime){ + $jBody ($i) + $bProcessBody(1) + $iTime(^cache[]) + }{$bProcessErrorHandler(1)$jExceptionHandler}] + + ^if($bProcessBody){ + Executed code, ^^cache[] value ^if(def $iTime){defined}{undefined}, }{ - Get cached result + ^if($bProcessErrorHandler){ + Process error handler, + }{ + Get cached result, + } } -
-} + + result: $sBody +}[
] +^iStep.inc(1)