Skip to content
Snippets Groups Projects
Commit cdd61db1 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-1522: wrap in BusListenerJanitor to auto-delete queue upon exit

parent 077aeb29
No related branches found
No related tags found
1 merge request!736TMSS-1377 & TMSS-1376: TMSS-adapted TBB scripts and gitlab/docker TBB builds
#!/usr/bin/env python #!/usr/bin/env python
from lofar.messaging.messagebus import BusListenerJanitor
from lofar.sas.tmss.client.tmssbuslistener import TMSSBusListener, TMSSEventMessageHandler from lofar.sas.tmss.client.tmssbuslistener import TMSSBusListener, TMSSEventMessageHandler
from lofar.sas.tmss.client.tmss_http_rest_client import TMSSsession from lofar.sas.tmss.client.tmss_http_rest_client import TMSSsession
from lofar.common.util import waitForInterrupt from lofar.common.util import waitForInterrupt
...@@ -188,7 +189,9 @@ def main(): ...@@ -188,7 +189,9 @@ def main():
else: else:
print("No observation running, waiting for next observation") print("No observation running, waiting for next observation")
with TMSSBusListener(handler_type=TBBTMSSEventMessageHandler, num_threads=1): # run TMSSBusListener with TBBTMSSEventMessageHandler
# wrap in BusListenerJanitor to auto-delete queue upon exit
with BusListenerJanitor(TMSSBusListener(handler_type=TBBTMSSEventMessageHandler, num_threads=1)):
waitForInterrupt() waitForInterrupt()
if __name__ == '__main__': if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment