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

Detach Library loading from Render thread #297

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

seakrueger
Copy link
Contributor

@seakrueger seakrueger commented Jun 16, 2024

In scenarios where the library takes a long amount of time to load, the application would become locked up and unresponsive, as library loading was blocking. By detaching library loading to its own thread, the program remains responsive even while the library is loading.

Eventually, a ProgressWidget should probably be added, but that would require a signifigant change to the logic of lib.open_library.

@CyanVoxel CyanVoxel added Type: Enhancement New feature or request TagStudio: Library Relating to the TagStudio library system labels Jun 16, 2024
@Thesacraft
Copy link
Collaborator

Don't worry about the Pyside app test failing for now (its a bug that is fixed now). But if you want to you can fix it by pulling the changes from the main branch and merging it into yours.

To get the return code from lib.open_library, CustomRunnable needs the
ability to return the int value. Since CustomRunnable is designed to be
generic, the signal returns of a value of any `object` type.
In scenarios where the library takes a long amount of time, the
application would become locked up and unresponsive, as library loading
was blocking. By detaching library loading to its own thread, the
program remains responsive even while the library is loading.
Prevents the same hang-up from loading an existing library for when a
new library is being created or additional entries are being added. As
`add_new_files_runnable` is no longer blocking, an additional signal was
needed to be added for the program to know when it was safe to display
the library.
@CyanVoxel CyanVoxel added the Status: Review Needed A review of this is needed label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed A review of this is needed TagStudio: Library Relating to the TagStudio library system Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants