I need to interact with a keypress handler object and call async methods on an interface so I have something like this:
loop = asyncio.get_event_loop()
def handle_keypress(key: str):
print("got key", key)
def handle_keypress_helper(key: str) -> None
loop.create_task(handle_keypress(key))
read_input.start(handle_keypress_helper)
If I add an on_properties_changed handler like so:
properties.on_properties_changed(on_properties_changed)
Then my key logs get blocked until a property changes. So say I press five keys, then after a property changes I finally get the logs of the five key presses.
So it looks like on_properties_changed is blocking other tasks during the wait for a property change and then they only get flushed after changes.
I need to interact with a keypress handler object and call async methods on an interface so I have something like this:
If I add an
on_properties_changedhandler like so:Then my key logs get blocked until a property changes. So say I press five keys, then after a property changes I finally get the logs of the five key presses.
So it looks like
on_properties_changedis blocking other tasks during the wait for a property change and then they only get flushed after changes.