# writeBlocking in a Vision Client

**URL:** <https://forum.inductiveautomation.com/t/writeblocking-in-a-vision-client/62427>\
**Category:** Ignition\
**Tags:** ignition81, scripting, ignition80, vision\
**Created:** [July 28, 2022, 7:53pm UTC](https://forum.inductiveautomation.com/t/writeblocking-in-a-vision-client/62427 "2022-07-28T19:53:22Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [July 29, 2022, 12:33am UTC](https://forum.inductiveautomation.com/t/writeblocking-in-a-vision-client/62427/3 "2022-07-29T00:33:31Z")

</div>

The recommendation is for the EDT, the foreground thread. All UI events run on this foreground thread. If you run a system function that has to contact the gateway, the foreground of the Vision client _ **stalls** _ for the round trip. If you are making such calls in many events all over the place, the UI will lag, especially on a WAN or VPN.

The deprecated `system.tag.write()` call is one of the few that **isn't** a problem, because it is really Async without the callback. Fire and forget, so to speak, and doesn't stall the UI. (It may be deprecated, but I don't see any of the deprecated functions going away any time soon.)

Note that the `actionPerformed` event on a button, because it is user-initiated, is generally an OK place for one or two such calls. Anything more complicated should be delegated to a background thread, where there won't be any UI interaction. However, background threads cannot update the UI themselves--deadlock risk. See this topic for more information:

> [@Update GUI via Asynchronous thread](https://forum.inductiveautomation.com/t/update-gui-via-asynchronous-thread/9666):
>
> I’ve got a script I am experimenting with that can take a lot of time to execute, so I now use the system.util.invokeAsynchronous to run the script in a separate thread to keep the GUI from locking up. I am using the asynchronous thread to copy files from one place to another, and I would like to show the progress of the file copy with a progress bar. How would I go about this? I am importing a few python libraries to do this. import shutil def fileTransfer(): path = system.file.openFile() …

---

_[View the full topic](https://forum.inductiveautomation.com/t/writeblocking-in-a-vision-client/62427)._
