-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Python] Use thread-safe futures for concurrent operations (#33891)
* [Python] Use thread-safe futures for concurrent operations Instead of using quasi-global variables in the ChipStack singleton use device controller local futures to store results from callbacks. This has several advantages, namely: - Avoid unnecessary shared state between device controllers - Avoid unnecessary shared state between various operations within a device controller (those who don't share callbacks could be called from different threads now) - Explicitly set Futures to None to detect spurious/unexpected callbacks - Better code readability - concurrent.futures are thread-safe - Will make asyncio transition easier This change shouldn't change the external API. * [Python] Fix EstablishPASESession API compatibility * [Python] Make ConnectBLE behave as before
Showing
2 changed files
with
184 additions
and
160 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