@main[] $sDir[outputs/160] $iStep(1) $iSleepTime(3) $iCacheTime(2) # wait till cache expire
File: 1 File: 2 File: 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}, }{ ^if($bProcessErrorHandler){ Process error handler, }{ Get cached result, } } result: $sBody }[
] ^iStep.inc(1)