# How to trigger a gateway timer to trigger immediately but no more than four times per minute?

**URL:** <https://forum.inductiveautomation.com/t/how-to-trigger-a-gateway-timer-to-trigger-immediately-but-no-more-than-four-times-per-minute/75476>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [June 23, 2023, 8:08pm UTC](https://forum.inductiveautomation.com/t/how-to-trigger-a-gateway-timer-to-trigger-immediately-but-no-more-than-four-times-per-minute/75476 "2023-06-23T20:08:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 23, 2023, 8:20pm UTC](https://forum.inductiveautomation.com/t/how-to-trigger-a-gateway-timer-to-trigger-immediately-but-no-more-than-four-times-per-minute/75476/2 "2023-06-23T20:20:00Z")

</div>

The tag system is fully multithreaded and only locks what **it** needs, not what some queuing algorithm needs. You will suffer trying to do this with a memory dataset tag.

Use a proper java concurrent queue. Set it up so that only a single copy is ever constructed (using system.util.getGlobals() and `.setdefault()`). Run a timer script that polls this queue, with a timeout the same as the fastest pace you want to run.

Only place python or java native data types in such a queue. (I usually use python tuples.)

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-trigger-a-gateway-timer-to-trigger-immediately-but-no-more-than-four-times-per-minute/75476)._
