I wrote a Design Pattern for this. Design Pattern: Event Limit
I need to update it a little so it matches the format of the other DPs but it is still accurate. It basically does what oupus suggested using a flag and what mikmartin’s code does, but the more detailed text description might be useful.