# invokeLater function problem in script Library

**URL:** <https://forum.inductiveautomation.com/t/invokelater-function-problem-in-script-library/31207>\
**Category:** Ignition\
**Created:** [January 10, 2020, 11:04am UTC](https://forum.inductiveautomation.com/t/invokelater-function-problem-in-script-library/31207 "2020-01-10T11:04:03Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [January 10, 2020, 1:34pm UTC](https://forum.inductiveautomation.com/t/invokelater-function-problem-in-script-library/31207/5 "2020-01-10T13:34:39Z")

</div>

FWIW, I implemented an emulation of invokeLater for gateway scope in my [later.py](https://www.automation-pros.com/ignition/later.py) helper script, mentioned here:

> [@Reset Tag Value after a Number of Seconds](http://forum.inductiveautomation.com/t/reset-tag-value-after-a-number-of-seconds/17098/9):
>
> It’s unfortunate that there’s no alternative to invokeLater in gateway scope. I may just have to add something to [later.py](https://www.automation-pros.com/ignition/later.py) to address this.

and here:

> [@Ignition 8 invokeLater function doesn't seem to exist](http://forum.inductiveautomation.com/t/ignition-8-invokelater-function-doesnt-seem-to-exist/25174/4):
>
> I’ve updated [later.py](https://www.automation-pros.com/ignition/later.py) for Ignition v8. It includes an implementation of invokeLater usable in gateway scope.

Note that it uses officially unsupported methods to obtain the appropriate context.

The official method of obtaining delays in gateway scope (per IA support) is to use a sleep in an asynchronous thread. That's just ugly. Almost unforgivable. /:

---

_[View the full topic](https://forum.inductiveautomation.com/t/invokelater-function-problem-in-script-library/31207)._
