Observed constant 0.1 cpu usage. Following tips from @SnoozeFreddo and @goteguru have looked at the _keep_alive function.
Development route:
Ran uvloop with uv_loop.run() from a new thread.
Cpu usage is still running in the _keep_alive method
Try not running the _keep_alive loop, the rest of the app works fine, except for anything using get_data. Find that after get_data calls set_result on the Future nothing happens, the asyncio run_forever loop doesn't know about the new result.
Wake up the asyncio loop with ( https://stackoverflow.com/questions/71831306/how-can-i-wake-up-an-event-loop-to-notify-it-that-a-future-was-completed-from ) after Future set_result calls (in socketify.py)
Forms, static files, websockets working.
Idle cpu usage seems gone.
Reopened pull request to rebase from cirospaciari/socketify.py main
Description
This PR fixes https://github.com/cirospaciari/socketify.py/issues/152
Observed constant 0.1 cpu usage. Following tips from @SnoozeFreddo and @goteguru have looked at the _keep_alive function.
Development route: Ran uvloop with uv_loop.run() from a new thread. Cpu usage is still running in the _keep_alive method Try not running the _keep_alive loop, the rest of the app works fine, except for anything using get_data. Find that after get_data calls set_result on the Future nothing happens, the asyncio run_forever loop doesn't know about the new result. Wake up the asyncio loop with ( https://stackoverflow.com/questions/71831306/how-can-i-wake-up-an-event-loop-to-notify-it-that-a-future-was-completed-from ) after Future set_result calls (in socketify.py)
Forms, static files, websockets working. Idle cpu usage seems gone.
Reopened pull request to rebase from cirospaciari/socketify.py main