minor fixes

This commit is contained in:
Wolfgang Hottgenroth 2021-11-10 15:29:38 +01:00
parent 2cbb39dccd
commit 937844e496
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F
3 changed files with 6 additions and 5 deletions

View File

@ -4,6 +4,6 @@ from AbstractSinkHandler import AbstractSinkHandler
# make sure other derived modules/classes from AbstractSinkHandler/AbstractSinkHandler
# use the same name for the module and the class within
class GenericSinkHandler(AbstractSinkHandler):
class DummySinkHandler(AbstractSinkHandler):
def sinkAction(self, dataObject):
logger.info(f"sink {self.name} received {dataObject} for experiment {self.experiment}")

View File

@ -12,6 +12,7 @@ from SlaveHandler import SlaveHandler
POISON_PILL = DataObject(name="PoisonPill", topic="kill", payload=None)
TIMEOUT_PILL = DataObject(name="TimeoutPill", topic="timeout", payload=None)
LOOP_SLICE = 0.1 # seconds
GRACE_PERIOD = 50
class e_State(Enum):
@ -37,7 +38,7 @@ class RigCmdHandler(threading.Thread):
while True:
try:
dataObject = self.inQueue.get(timeout=0.1)
dataObject = self.inQueue.get(timeout=LOOP_SLICE)
except Empty:
dataObject = TIMEOUT_PILL
if (dataObject == POISON_PILL):

View File

@ -11,15 +11,15 @@ slaves=dev05 dev06 rig01
[dev05]
topic=rd/set01/rig01/dev05/md
dataObjectName=value
sinkHandler=GenericSinkHandler
sinkHandler=DummySinkHandler
[dev06]
topic=rd/set01/rig01/dev06/md
dataObjectName=value
sinkHandler=GenericSinkHandler
sinkHandler=DummySinkHandler
[rig01]
topic=rd/set01/rig01/log
dataObjectName=log
sinkHandler=GenericSinkHandler
sinkHandler=DummySinkHandler