# [hmr] `self.on_events(...)` calls should be locked