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

Self-interrupting code: QtReactor.doIteration() calling processEvents() #11

Open
altendky opened this issue Nov 12, 2016 · 2 comments
Open

Comments

@altendky
Copy link
Member

I started with my first Twisted code in a standalone script though still using PyQt5 due to some of my leveraged code for CANbus interfacing. This went quite well but when I started to integrate it back into my application I ran into trouble after adding feedback from 'the twisted code' to a QProgressDialog. It didn't matter if I used a signal/slot or called directly to QProgressDialog.setValue(), I would quickly get my code interrupted (within the same thread) resulting in receiving a network response (coming in via a signal/slot connection) before I finished the post-send code.

While the python-can library underlying my CANbus communication does use a thread from which it provides incoming messages, I have all of those routed through signals/slots to hop the thread boundary safely. I also double checked and the code that was seemingly interrupted and the supposed interrupting code both report the same threading.get_ident(). This suggests to me that it isn't a threading issue (though... I'm not ruling it out. :] ).

See my (to be linked) commit that alleviates this. I will also link my code once I have the exact revision pushed.

altendky added a commit to altendky/qt5reactor that referenced this issue Nov 12, 2016
altendky added a commit to altendky/qt5reactor that referenced this issue Dec 19, 2016
Helps avoid twisted#11 in a better way and across platforms
@crwood
Copy link
Collaborator

crwood commented May 17, 2017

Nice catch on noticing that QTimer wasn't using fromqt.

Would you like to open up a pull request for this (against current master)?

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