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

Updated Code to Introduce Asynchronous Computation of Connected Compo… #2638

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IamLRBA
Copy link

@IamLRBA IamLRBA commented Dec 19, 2024

As per issue #2636

The updated code introduces asynchronous computation of the connected components using a Job to avoid blocking the UI thread.

@mickaelistria
Copy link
Contributor

Please remove the .idea/* files from the commit. The Eclipse Platform project usually doesn't maintain metadata for other IDEs

Copy link
Contributor

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

If you use a completable future to return the async computation and complete it with the result in the job then the caller can easily act on the result (e.g. execute something in UI or transform it further)

//these two projects are related, so join their sets
if (setOne != null && setTwo != null && setOne != setTwo) {
set.union(setOne, setTwo);
private static void buildConnectedComponentsInBackground(IProject[] projects, Runnable onComplete) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private static void buildConnectedComponentsInBackground(IProject[] projects, Runnable onComplete) {
private static CompletableFuture<DisjointSet<IProject>> buildConnectedComponentsInBackground(IProject[] projects) {

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

Successfully merging this pull request may close these issues.

3 participants