@main[] $sDir[outputs/160] $iStep(1) $iSleepTime(3) $iCacheTime(2)
| Info | File: 1 | File: 2 | File: 3 | File: 4 |
|---|---|---|---|---|
| Exec body on 1st step, then just get cached result | ^do[1](3){One} | ^do[2](3){Two} | ^do[3](3){Three} | |
| Value in cache not expired yet. | ^do[3](3){ ^method[] }{ $exception.handled(1) ^cache(2) Error while executing body } | |||
| Wait for 3 secs. Cache expired for sure. | ^sleep($iSleepTime) ^^sleep($iSleepTime) | |||
|
1. Body code has an exception but force get cached result 2. Execute body and set ^^cache(0) for prevent cacheing 3. Body code has an exception, execute catch section and set ^^cache(0) |
^do[1](3){ ^method[] }{ ^cache(1) $exception.handled[cache] force get cached resuls } | ^do[2](3){ Two ^cache(0) } | ^do[3](3){ ^method[] }{ $exception.handled(1) ^cache(0) Catch section results } | ^do[4](3){ ^method[] } |