From 64c238899a62f2400af7901fe82cf36053236046 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Thu, 2 Sep 2021 20:59:02 +0200 Subject: [PATCH] introduce a worker thread for the planning tasks --- aman/sys/Worker.py | 21 +++++++++++++++++++++ aman/sys/__init__.py | 0 2 files changed, 21 insertions(+) create mode 100644 aman/sys/Worker.py create mode 100644 aman/sys/__init__.py diff --git a/aman/sys/Worker.py b/aman/sys/Worker.py new file mode 100644 index 0000000..83c33fe --- /dev/null +++ b/aman/sys/Worker.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python + +import threading + +from aman.config.Airport import Airport + +class Worker(threading.Thread): + def __init__(self, icao : str, configuration : Airport): + threading.Thread.__init__(self) + + self.stopThread = None + self.icao = icao + self.configuration = configuration + + def stop(self): + self.stopThread = True + + def run(self): + while None == self.stopThread: + # TODO execute planning, etc. + continue diff --git a/aman/sys/__init__.py b/aman/sys/__init__.py new file mode 100644 index 0000000..e69de29