-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make YubiKeyDeviceListener resettable
Currently, YubiKeyDeviceListener only exposes a singleton instance with no way for a consumer to reset it once it is started. The constructor is private, so the consumer has no option to use a private instance. This adds the ability for the consumer to reset the lazy-initialized singleton so that the listen thread doesn't stick around. Also, even though this class implemented IDisposable, most things that need to be in the Dispose method weren't there, including a way to stop the thread. The listen thread is now replaced by an asynchronous task that doesn't consume a system thread while it's not working.
- Loading branch information
1 parent
e1dbe19
commit 63eea0e
Showing
2 changed files
with
84 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters