Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor/get_rid_of_sleeps #57

Open
JarbasAl opened this issue Mar 7, 2023 · 1 comment
Open

refactor/get_rid_of_sleeps #57

JarbasAl opened this issue Mar 7, 2023 · 1 comment
Labels
refactor code improvements with no functional changes

Comments

@JarbasAl
Copy link
Member

JarbasAl commented Mar 7, 2023

as mentioned in #53 we have a few places with hardcoded sleeps

these should be refactored out where possible, usually we can listen to (or add a new) bus event

do_a()
sleep(1)
do_b()

becomes

self.bus.once("bla", do_b)
do_a()

the new bus event will need to be sent from GUI side in some places of OCP

@JarbasAl JarbasAl added the refactor code improvements with no functional changes label Mar 7, 2023
@JarbasAl JarbasAl self-assigned this Mar 7, 2023
@JarbasAl
Copy link
Member Author

JarbasAl commented Mar 7, 2023

more generically, i think we need to support some callback in self.gui.show_page for when page actually finished loading

{
    "type": "mycroft.events.triggered",
    "namespace": "mycroft.weather",
    "event_name": "page_gained_focus",
    "data": {"number": 0}
}

the above should be enough and is define in GUI transport protocol, ovos-gui should emit 'gui.page_gained_focus' when this happens which we can listen for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor code improvements with no functional changes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant