From 968f774092c2601af1c6213ba5d509c9d10e866e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Wed, 25 Sep 2024 19:37:33 +0200 Subject: [PATCH] always create a new event loop in the client and pass it to a new thread --- src/pydase/client/client.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/pydase/client/client.py b/src/pydase/client/client.py index 6a82514..407d5c7 100644 --- a/src/pydase/client/client.py +++ b/src/pydase/client/client.py @@ -8,7 +8,6 @@ import socketio # type: ignore import pydase.components from pydase.client.proxy_loader import ProxyClassMixin, ProxyLoader -from pydase.utils.helpers import current_event_loop_exists from pydase.utils.serialization.deserializer import loads from pydase.utils.serialization.types import SerializedDataService, SerializedObject @@ -109,11 +108,7 @@ class Client: ): self._url = url self._sio = socketio.AsyncClient() - if not current_event_loop_exists(): - self._loop = asyncio.new_event_loop() - asyncio.set_event_loop(self._loop) - else: - self._loop = asyncio.get_event_loop() + self._loop = asyncio.new_event_loop() self.proxy = ProxyClass(sio_client=self._sio, loop=self._loop) """A proxy object representing the remote service, facilitating interaction as if it were local."""