Skip to content
Snippets Groups Projects
Commit 7b39600e authored by Sergey Esenov's avatar Sergey Esenov
Browse files

Use 'preDestruction' method for stopping threads

parent 5cacc942
No related branches found
No related tags found
1 merge request!6Periodic tasks in python bound
......@@ -412,15 +412,14 @@ slot of ``start`` button or another function that should activate
the periodic task.
Attention! If this device is killed the ``slotKillDevice`` is called,
so it is important to re-implement ``slotKillDevice`` method in ``Klass``
class to stop running our polling loop above
which calls ``preDestruction`` method in turn. so it is important to
re-implement ``preDestruction`` method in ``Klass`` class to stop
running our polling loop above
.. code-block:: python
def slotKillDevice(self):
def preDestruction(self):
self.running = False # stop the loop
# call parent version of slotKillDevice method
super(Klass, self).slotKillDevice()
Please follow this pattern to allow ``karabo-stop`` of python server
working properly. Otherwise the device and server may hang up!
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