Subscribe to App Update Event

If you would like to execute code for every update loop, you can can subscribe to app update events. By providing a callback function, Kit will execute your callback on every update loop. The event payload has a dt key that represents the time since the last loop. (i.e. delta time)


This event fires very frequently. A callback with long-running code will block the UI and make the app unresponsive.


update_stream =

def on_update(e:
    print(f"Update: {e.payload['dt']}")

sub = update_stream.create_subscription_to_pop(on_update, name="My Subscription Name")