mgarin / weblaf

WebLaF is a fully open-source Look & Feel and component library written in pure Java for cross-platform desktop Swing applications.
http://weblookandfeel.com
GNU General Public License v3.0
1.13k stars 234 forks source link

Simple TaskManager implementation #576

Closed mgarin closed 4 years ago

mgarin commented 4 years ago

At this point WebLaF has quite a few things that are executed on separate threads - thumbnail generation, asynchronous tree data loading, link actions, file system interactions, animations and some other minor things. A few new things are also coming in future updates.

As of right now - there is no convenient way to configure (and primarily limit) how those threads are created and managed which might be quite inconvenient depending on application and system specifics. There are also quite a few different solutions created across WebLaF code that manage threads for specific tasks which only makes it more complicated.

That is why I've been working on a new and rather small TaskManager that would allow managing custom TaskGroups which will be used to run all asynchronous tasks within WebLaF and can also be used to manage such tasks for your own application as well. TaskManager won't have anything ground-breaking - it will simply provide a simple API for managing task groups and executing tasks within a particular group.

I also plan to expand this feature in the future with it's own custom UI that would provide visual feedback for all running tasks and ability to manage them.

mgarin commented 4 years ago

TaskManager have was added in recent commit and will be available in v1.2.11 release. It will also be available quite soon in SNAPSHOT artifacts: https://oss.sonatype.org/content/repositories/snapshots/com/weblookandfeel/