Files
purple-electrumwallet/tests
SomberNight 70d1e1170e asyncio: clarify strong refs for run_coroutine_threadsafe
We added some code in https://github.com/spesmilo/electrum/commit/0b3a28358681a0fe101bd6fc3feb5ff981fb68ce
to explicitly hold strong refs for all tasks/futures. At the time I was uncertain if that also solves
GC issues with asyncio.run_coroutine_threadsafe.
ref https://github.com/spesmilo/electrum/pull/9608#issuecomment-2703681663

Looks like it does. run_coroutine_threadsafe *is* going through the custom task factory.
See the unit test.
The somewhat confusing thing is that we need a few event loop iterations for the task factory to run,
due to how run_coroutine_threadsafe is implemented. And also, the task that we will hold as strong ref
in the global set is not the concurrent.futures.Future that run_coroutine_threadsafe returns.

So this commit simply "fixes" the unit test so that it showcases this, and removes related, older, plumbing
from util.py that we now know is no longer needed because of this.
2025-04-08 18:54:58 +00:00
..
2025-03-19 11:59:05 +01:00
2025-04-02 16:21:59 +00:00
2024-04-24 14:14:31 +00:00
2025-02-19 14:29:02 +01:00
2024-06-10 20:22:20 +00:00