From 4bf1c1ffe795a1d28a543a20cc3771a30a090b89 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 6 May 2025 19:33:30 +0200 Subject: Added a dedicated thread for handling events sent to the endpoint --- interfaces/endpoint.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'interfaces/endpoint.py') diff --git a/interfaces/endpoint.py b/interfaces/endpoint.py index 2d77b66..4da7c57 100755 --- a/interfaces/endpoint.py +++ b/interfaces/endpoint.py @@ -47,6 +47,7 @@ from zope import component import json from interfaces.message import IMessage, Debug +from consumer import Mapping @component.adapter(IConnection) @interface.implementer(IEndpoint) @@ -74,7 +75,7 @@ class EndPoint(object): # This is the first connection # Otherwise the state should be STATE_CONNECTING # Initialize with the default layer - self.queue.put ( ("default", None) ) + component.handle(Mapping(("default", None))) except Exception as e: print(e) @@ -103,7 +104,7 @@ class EndPoint(object): title = desktop.getForegroundWindowTitle() else: title = None - self.queue.put((layout, title)) + component.handle(Mapping((layout, title))) def send(self, data: list[dict[str, str]]): """ Send the data to the endpoint. The data must be the representation -- cgit v1.2.3