fix(bec dispatcher): make a new BECClient in _BECDispatcher constructor and process events while waiting

This commit is contained in:
2024-02-27 13:54:37 +01:00
parent 9c822ec480
commit 8b43eba282
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -5,6 +5,7 @@ import uuid
from functools import wraps
from qtpy.QtCore import QCoreApplication
import bec_widgets.cli.client as client
from bec_lib import MessageEndpoints, messages
@@ -170,4 +171,5 @@ class RPCBase:
response = self._client.connector.get(
MessageEndpoints.gui_instruction_response(request_id)
)
QCoreApplication.processEvents() # keep UI responsive (and execute signals/slots)
return response
+1 -1
View File
@@ -35,7 +35,7 @@ class _BECDispatcher(QObject):
def __init__(self, bec_config=None):
super().__init__()
self.client = BECClient()
self.client = BECClient(forced=True) # make a new instance
# TODO: this is a workaround for now to provide service config within qtdesigner, but is
# it possible to provide config via a cli arg?