Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread detector & dispatcher are not daemon threads.... #21

Closed
titioft opened this issue May 25, 2015 · 1 comment
Closed

Thread detector & dispatcher are not daemon threads.... #21

titioft opened this issue May 25, 2015 · 1 comment

Comments

@titioft
Copy link

titioft commented May 25, 2015

I am building a daemon script to start/stop my PIFace water counter script. I use the pifacedigitalio.InputEventListener class for that but the thread launch @ activate ar enot daemon threads so when my main process hangs / be killed or stops the detector / dispatcher threads are still up... which is really annoying. Can you add a paramater 'daemon' into your activate methods to set daemon thread parameter to true or false depending of what we want ot do.

@tompreston
Copy link
Member

PiFace Common v4.2.0:

  • Added daemon flag for PortEventListener.

PiFace Digital IO v3.1.0:

  • Added daemon flag for InputEventListener.

The new flag is used like this:

listener = pifacedigitalio.InputEventListener(pfd, daemon=True)

I'm afraid I'm too busy at the minute to push these to the Raspbian repos (and update the docs) but I'll get around to it as soon as I can. In the mean time you can either clone this repo or use this work around:

listener = pifacedigitalio.InputEventListener(pfd)
listener.detector.daemon = True
listener.dispatcher.daemon = True

I hope that helps! It certainly has for me -- the hanging thing was massively frustrating! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants