# Can we use system.util.invokeAsynchronous in Ignition Perspective to call custom functions in components?

**URL:** <https://forum.inductiveautomation.com/t/can-we-use-system-util-invokeasynchronous-in-ignition-perspective-to-call-custom-functions-in-components/76282>\
**Category:** Ignition\
**Tags:** vision, perspective\
**Created:** [July 12, 2023, 9:02pm UTC](https://forum.inductiveautomation.com/t/can-we-use-system-util-invokeasynchronous-in-ignition-perspective-to-call-custom-functions-in-components/76282 "2023-07-12T21:02:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 12, 2023, 9:19pm UTC](https://forum.inductiveautomation.com/t/can-we-use-system-util-invokeasynchronous-in-ignition-perspective-to-call-custom-functions-in-components/76282/3 "2023-07-12T21:19:31Z")

</div>

You absolutely _can_ invoke async threads. It's a relatively heavyweight operation though, and I would not recommend it just for slightly better developer ergonomics. Embrace message handlers so that work happens on existing Perspective worker threads as much as possible.

> [@rahman.tarek](#):
>
> In vision what i would do is create a custom function in the pie chart component and then use system.util.invokeAsynchronous on the button and the dropdown to call the custom function and update the pie chart.

As an aside, doing this in Vision is dangerous (prone to locking up the event dispatch thread) unless you're leaping from that async thread back to the EDT with `system.util.invokeLater`. If you are, ignore this, but if you aren't, you should really fix your script(s).

---

_[View the full topic](https://forum.inductiveautomation.com/t/can-we-use-system-util-invokeasynchronous-in-ignition-perspective-to-call-custom-functions-in-components/76282)._
