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

Merge ToolConfWatchers and separate from Toolbox #3821

Merged
merged 7 commits into from
Apr 7, 2017

Conversation

mvdbeek
Copy link
Member

@mvdbeek mvdbeek commented Mar 27, 2017

This should avoid some complexities associated with managing threads.

@mvdbeek mvdbeek added area/tools kind/refactoring cleanup or refactoring of existing code, no functional changes status/WIP labels Mar 27, 2017
@mvdbeek mvdbeek added this to the 17.05 milestone Mar 27, 2017
t = threading.Thread(target=self.event_handler.on_any_event)
t.daemon = True
t.start()
self.reload_callback()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can reduce the indentation here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that wasn't flagged by tox!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like I'm more 🦅 than flake8 😆

@nsoranzo
Copy link
Member

Looks much cleaner, thanks @mvdbeek!

This should avoid some complexities associated with managing threads.

I would also like to eliminate the separate reload_tool_data_tables
and reload_data_managers callbacks and do this when reloading the
toolbox, but every tool data table reload triggers twice the download of
http://igv.broadinstitute.org/genomes/genomes.txt, which each time takes
2 seconds.
from galaxy.queue_worker import (
reload_data_managers,
reload_toolbox,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing in galaxy.tools.toolbox should depend on galaxy.queue_worker IMO. The former module is meant to stand-alone from the app and models - hence the subclassing of ToolBox from AbstractToolBox and the inclusion on that module in galaxy-lib. Can you refactor this config watcher stuff into say galaxy.tools.watchers or galaxy.webapps.galaxy.config_watchers perhaps.

Copy link
Member Author

@mvdbeek mvdbeek Apr 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I think I've done that in 1a5e337.

@mvdbeek mvdbeek changed the title [WIP] Merge ToolConfWatchers and separate from Toolbox Merge ToolConfWatchers and separate from Toolbox Apr 3, 2017
@mvdbeek
Copy link
Member Author

mvdbeek commented Apr 3, 2017

This is ready for review now.
I think this is good progress in itself, I will try to further merge the individual threads into 1, if I can speed up the data table reloading.



class ConfigWatchers(object):
"""Contains ToolConfWatcher, ToolWatcher and ToolDataWatcher objects."""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this class does not contain a ToolWatcher.

Copy link
Member Author

@mvdbeek mvdbeek Apr 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I've made that change in f79fb90

@mvdbeek mvdbeek changed the title Merge ToolConfWatchers and separate from Toolbox WIP: Merge ToolConfWatchers and separate from Toolbox Apr 3, 2017
@mvdbeek mvdbeek changed the title WIP: Merge ToolConfWatchers and separate from Toolbox Merge ToolConfWatchers and separate from Toolbox Apr 3, 2017
@jmchilton
Copy link
Member

Agreed with @nsoranzo - this is really nice! What a better separation of concerns - very crisp. 💯

@jmchilton jmchilton merged commit e7a4ae5 into galaxyproject:dev Apr 7, 2017
@mvdbeek mvdbeek deleted the repository_updates branch June 12, 2018 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tools kind/refactoring cleanup or refactoring of existing code, no functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants