Design Pattern: Do While

Problem Statement

Sometimes a user wants to perform some sort of action or activate polling during a certain period of time after another event occurs.

This Design Pattern is deprecated. Please see Design Pattern: Looping Timers for a better approach.


Why not more efficiently val end = now.plusMinutes(10)?

Because I was in a hurry and clearly didn’t think it through. :blush:

That is better. Editing the original.

1 Like

This always gave me syntax errors, as “end” is a reserved keyword? I ended up using another name for the variable “end”, then the example works fine.

Thanks, but really I should remove Example 2. You should not have a long running Rule like that. It can be really bad. Use Design Pattern: Looping Timers instead.