First, in both of those statements in both of those posts it’s referring to OH 2, not OH 3. There was a major change in OH 3 that greatly reduces the impact of long running rules. In OH 2, there were a mere 5 threads shared by all your rules with an additional 3 (IIRC) threads for cron triggered rules and Timers. If you had long running rules you’d consume one of those threads and block other rules ability to run. In OH 3, each rule gets their own dedicated thread. So now a long running rule only impacts that one rule, not all your rules.
Secondly, Looping Timers is a way to solve the problem of long running rules. That whole DP post is to show how to use Looping Timers to avoid long running rules.
However, let’s pretend that long running rules are still a really big deal.
If I create a timer to go off in now.plusMinutes(5) (i.e. five minutes from now), the rule is only running long enough to create the timer. The rule will stop executing and return in milliseconds.
Then in five minutes the timer will be triggered and the timer will only be running long enough to execute the code that was passed to it, again usually just a few milliseconds.
All the rest of the time the rule is not running. No thread is being consumed. No resources are being blocked. A looping timer is not a busy wait loop. It’s a way to asynchronously schedule a block of code to run at a later time.
There is no long running rule here. There is a few milliseconds worth of execution every five minutes as the looping timer triggers, exactly the same as a cron triggered rule would consume. The only difference, is we have more control over when and how the looping timer executes (e.g. we can change how often it runs on the fly based on state or events, trigger it to start running immediately upon an event, etc.).
But you are not running a fresh script. It’s fresh only the first time the rule is triggered and run. The script is reused on every run after that. If you want a fresh rule, you need to disable and reenable it on every run or reload the file it’s defined in or something.
In fact, if you did want to have a fresh script on every run of the rule, you’re better able to create that situation by using a looping timer. The rule will trigger based on some event. When it triggers it can cancel and create a fresh new looping timer.