hephy-dd / comet

COMET - Control and Measurement Toolkit
GNU General Public License v3.0
2 stars 2 forks source link

Using process with functions #42

Closed arnobaer closed 4 years ago

arnobaer commented 4 years ago

Provide an convenient way of using class comet.Process with functions (like class threading.Thread). Attribute target is called if no custom implementaion of run() is provided.

>>> def run(p):
...     while p.running:
...         pass
...
>>> p = comet.Process(id="proc", target=run)
>>> p.start()