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

Event loop issues #273

Open
romgrk opened this issue Mar 22, 2021 · 0 comments
Open

Event loop issues #273

romgrk opened this issue Mar 22, 2021 · 0 comments

Comments

@romgrk
Copy link
Owner

romgrk commented Mar 22, 2021

So a bit more issues with the event loop. Apparently, if we start the glib main loop from within a microtask callback, then all the microtasks created from within this loop will not resolve until the loop exits. I can see why it would do that but maybe we can try to find a way to solve it. Maybe the solution is using qode.

// top-level of the file, works
const app = new Gtk.Application()
app.on('activate', () => { queueMicrotask(() => console.log('called')) })
app.run()
// within a microtask callback, does not work
const app = new Gtk.Application()
app.on('activate', () => { queueMicrotask(() => console.log('called')) })
Promise.resolve().then(() => {
  app.run()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant