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

Snippets hang UI #4

Open
yrp604 opened this issue May 12, 2020 · 4 comments
Open

Snippets hang UI #4

yrp604 opened this issue May 12, 2020 · 4 comments
Labels
Impact: Medium Issue is impactful with no workaround

Comments

@yrp604
Copy link

yrp604 commented May 12, 2020

2144-dev Personal, Windows

import time
time.sleep(20)

Will render the UI entirely unresponsive. Obviously sleeping in a snippet like this is stupid, but it's the same behavior as iterating over a bunch of data.

@psifertex
Copy link
Member

I've been experimenting with background threads, but iirc there's a reason it intentionally does not background right now. We'll see how the testing goes.

@yrp604
Copy link
Author

yrp604 commented May 13, 2020

Sounds good.

An idea I had that might be more generally useful, have you used click or other progress bar things apis? https://click.palletsprojects.com/en/7.x/utils/#showing-progress-bars

Something like that when iterating over bbs that was blessed in some way to update the UI would be really slick.

@psifertex
Copy link
Member

psifertex commented May 14, 2020

Oh, that's a neat idea. I dunno if it would be easy to generically add though. There's probably too many things with iterators to try to hook/check/update.

But maybe some better snippet samples showing how to leverage that for better feedback would be helpful if the background thread doesn't work out (background thread can do a similar thing with the status bar if it works)

And also has a cancel button which is great.

@psifertex
Copy link
Member

I've just pushed a background thread version of snippets execution. I still can't figure out a way to make them interruptible but in the meantime this at least lets you close down more gracefully and or otherwise still interact with the UI. Could use some more testing before I push it to the plugin manager, feedback welcome.

@psifertex psifertex added the Impact: Medium Issue is impactful with no workaround label Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impact: Medium Issue is impactful with no workaround
Projects
None yet
Development

No branches or pull requests

2 participants