mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 11:41:49 +02:00
refactor: bec_dispatcher.py changed to Ivan's version
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import itertools
|
import itertools
|
||||||
import os
|
import os
|
||||||
from dataclasses import dataclass
|
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
|
|
||||||
from bec_lib import BECClient
|
from bec_lib import BECClient
|
||||||
@ -16,17 +15,15 @@ _signal_class_factory = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class _Connection:
|
class _Connection:
|
||||||
"""Utility class to keep track of slots connected to a particular redis consumer"""
|
"""Utility class to keep track of slots connected to a particular redis consumer"""
|
||||||
|
|
||||||
consumer: RedisConsumerThreaded
|
def __init__(self, consumer) -> None:
|
||||||
slots = set()
|
self.consumer: RedisConsumerThreaded = consumer
|
||||||
# keep a reference to a new signal class, so it is not gc'ed
|
self.slots = set()
|
||||||
_signal_container = next(_signal_class_factory)()
|
# keep a reference to a new signal class, so it is not gc'ed
|
||||||
|
self._signal_container = next(_signal_class_factory)()
|
||||||
def __post_init__(self):
|
self.signal: pyqtSignal = self._signal_container.signal
|
||||||
self.signal = self._signal_container.signal
|
|
||||||
|
|
||||||
|
|
||||||
class _BECDispatcher(QObject):
|
class _BECDispatcher(QObject):
|
||||||
|
Reference in New Issue
Block a user