Medi Montaseri
Medi Montaseri

Reputation: 125

PyQt signal-slots and OS events

My PyQt application needs to learn about certain OS events (such as Unix Signals, or Filesystem events). For example, say myReaper (a unix process) will execute myProvider (another Unix process) and waits for for its child to exit. myReaper then want to communicate the exit status to myQtApp.

  1. One solution would be for myReaper to (unix) signal myQtApp. But seems like I'd need to go through a socketpair or similar workarounds, see https://doc.qt.io/qt-5/unix-signals.html
  2. Another solution would be for myReaper to write status to a file and myQtApp wakes up via PyInotify (FS events) and read the content. I think this would also suffer from similar issues as unix signals.
  3. Another solution would be to use QTimer to wake up every so often and check a file. A polling based system but with minimal plumbing to OS events.

Has anyone dealt with this type of problem? What do you recommend?

Thanks

Upvotes: 0

Views: 129

Answers (0)

Related Questions