Conversation
Transitioned all major functions to asynchronous counterparts with `async` and `await` keywords. Replaced `put` with `put_nowait` for non-blocking event handling in input queues, and replaced `time.wait` with `asyncio.sleep` for better performance. Added import for `asyncio` where necessary, and removed unused imports to clean up the code.
Introduced new async compatibility functions in pcbasic/compat/asyncio.py. Refactored multiple methods across different modules to include `async` and `await` keywords. This enhances the program's handling of asynchronous operations and improves overall efficiency.
|
Hi @nmanumr, apologies I haven't had time to look into the PR in detail and indeed to try the code. Part of the problem is that to be honest I'm unfamiliar with the async style of concurrency in Python, and this is obviously a large PR that pervades the whole code base, so would need to brush up, and there's a lot to test manually (e.g. I do still intend to try this and play with it, just wanted to be open about my limited time/focus on this project and not create unrealistic expectations. |
|
Hi, @robhagemans, I completely forgot that I had opened the PR. I appreciate your openness, and I’ve been thinking about the number of changes as well. Initially, I didn’t expect it to turn into such a large change, so I think it would be worthwhile to look for a simpler solution. In the meantime, let’s close the PR, as this may not be the right approach. I’ll open a new PR once I come up with a simpler solution. |
As discussed in #243, This PR Ports the whole codebase to asyncio.
Todos: