# invokeAsync decorator

**URL:** <https://forum.inductiveautomation.com/t/invokeasync-decorator/16226>\
**Category:** Ignition\
**Created:** [December 6, 2017, 5:26am UTC](https://forum.inductiveautomation.com/t/invokeasync-decorator/16226 "2017-12-06T05:26:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cmisztur2](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmisztur2/32/4243_2.png) [@cmisztur2](https://forum.inductiveautomation.com/u/cmisztur2)\
**Post date:** [December 6, 2017, 5:45am UTC](https://forum.inductiveautomation.com/t/invokeasync-decorator/16226/2 "2017-12-06T05:45:36Z")

</div>

got it.

```auto
def async(func):
	def inner(*args,**kwargs): 
		def async(func=func,args=args,kwargs=kwargs):
			func(*args,**kwargs)
		system.util.invokeAsynchronous(async)
		
	return inner
	
@async
def somefunc(p1,p2):
	print str(p1+p2)
	
print "1"
somefunc(1,1)
print "3"

```

ref: [Update GUI via Asynchronous thread](http://forum.inductiveautomation.com/t/update-gui-via-asynchronous-thread/9666/2)

---

_[View the full topic](https://forum.inductiveautomation.com/t/invokeasync-decorator/16226)._
