# Script in background

**URL:** <https://forums.unrealengine.com/t/script-in-background/242013>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [July 22, 2021, 3:26pm UTC](https://forums.unrealengine.com/t/script-in-background/242013 "2021-07-22T15:26:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jobim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jobim](https://forums.unrealengine.com/u/jobim)\
**Post date:** [July 22, 2021, 3:26pm UTC](https://forums.unrealengine.com/t/script-in-background/242013/1 "2021-07-22T15:26:43Z")

</div>

Hi, I have a python script that is connecting to a webrtc server with websockets. I want this script to receive commands in background, but the asyncio library blocks the unreal UI.  
Is there a way to run a script in background without blocking the UI?  
Thanks.

---

<div class="post-metadata">

**Author:** ![Okliman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Okliman](https://forums.unrealengine.com/u/Okliman)\
**Post date:** [December 24, 2024, 10:01pm UTC](https://forums.unrealengine.com/t/script-in-background/242013/2 "2024-12-24T22:01:29Z")

</div>

You could probably try using multithreading lib from python(not threading) or use direct ping instead of async(not the best practice, i know…) or try to do it with language that does not block whole thread from execution(by GIL) such as cpp.

Found the topic while searching for already implemented solution…
