Let's say I'm listening whether a random event has happened. (Specifically I'm doing this via a webhook. After I receive a webhook, I execute code)
I do not want my webhook event to execute code more than once in a given timeframe, e.g. 30 minutes. However, I don't mean it in this way:
"Received webhook?"
"Wait 30 minutes until you can listen to webhooks again."
Somehow I'd like to split the 24hrs of the day into 48 parts of 30 minutes, and then the webhook can activate it's event only once in a given part. [for clarification: if it was 20mins then there would be 72 parts of 20mins]
For example: The code activates at 14:21. The next possible time I want it to activate would be at 14:30. Until 14:30 I don't want the code to activate more than it already did (once). Then again from 14:30 to 15:00, I want it to activate maximum once, and so on.
I don't necessarily need to divide the day like so, I'm just trying to explain what I need.
I hope I explained myself clearly.