-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Configurable polling interval? #41
Comments
Active polling is bad and should not be used by PySCard. I do not use I will have a look at the code. But I don't know when I will have time for that. |
I had a look at the My problem is that I am not sure of what the methods are supposed to do. The documentation is very limited. @tycho, why do you want to change the polling interval? |
A fair question. The app I'm using the library in has an option to minimize to the system tray. And while it's there, it doesn't need to interact with a smart card. The problem is that the pyscard ReaderMonitor and CardMonitor threads poll so frequently that the app will do nothing useful and eat away at battery life on laptops. My first option was to clean up everything pyscard related and re-initialize it all when the app is restored from the tray. But then I started running into all kinds of weird crashy behavior that I couldn't explain. It turns out it's really hard to properly shut down and clean up all the pyscard stuff. The second option is to leave the pyscard objects as they are, but make them poll less frequently to eat less CPU. So when my app is minimized to the tray, I set a really long poll interval, and when the app is restored, I restore the original short poll intervals. |
I do not plan/have time to rewrite Maybe you can change your application to stop using |
I changed it to stop using ReaderMonitor/CardMonitor at all, and that has
helped greatly. The code I replaced it with:
https://github.com/tycho/yubioath-desktop/blob/master/yubioath/gui/ccid.py
…On Tue, May 23, 2017 at 8:34 AM, Ludovic Rousseau ***@***.***> wrote:
I do not plan/have time to rewrite ReaderMonitor and CardMonitor now.
So a patch is welcome.
Maybe you can change your application to stop using ReaderMonitor and
CardMonitor while in the system tray?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABzsAaiMH2nipidwMHpj-dPqpIK9RDFks5r8vxzgaJpZM4Ne4RH>
.
|
Hello, I also add troubles with the threads polling speed while testing pyscard. After giving a look at the There is also a pollinginterval parameter for the The current So, I think, a polling interval between each On top of that, I also discovered that when you create a
This is due to the I made some changes to If you are interested in these changes, or if you want to add them to pyscard @LudovicRousseau, they are available on my fork of pyscard on the |
I did not write the Thanks for the patches @ElouanPetereau. I may have a look but I don't know when. |
You're welcome. And yes of course using |
This is now fixed in version 2.2.0. |
Can you please make the card monitoring thread's polling interval configurable?
My current hack works, but makes me sad:
CardMonitoringThread's
cardrequest
field doesn't exist until the thread starts. So I have to wait before I can monkey-patch the polling interval value.It'd be infinitely better if I could just set the polling interval when I create a CardMonitor instance, or if I could use a function call to set it (or both!)
The text was updated successfully, but these errors were encountered: