Skip to content

Conversation

@ToddGrun
Copy link
Contributor

This changes it's behavior to be exactly like InitializeAsync in that it uses this mechanism to minimze thread switches.

Also:

  1. Renamed PackageRegistrationTasks to PackageLoadTasks
  2. Removed the IProgress paramater as it wasn't used and doesn't fit well with OnAfterPackageLoadedAsync
  3. Moved service broker service proffering to background thread

This changes it's behavior to be exactly like InitializeAsync in that it uses this mechanism to minimze thread switches.

Also:
1) Renamed PackageRegistrationTasks to PackageLoadTasks
2) Removed the IProgress paramater as it wasn't used and doesn't fit well with OnAfterPackageLoadedAsync
3) Moved service broker service proffering to background thread
@ToddGrun ToddGrun requested a review from a team as a code owner March 19, 2025 23:00
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 19, 2025
}

public void RegisterInitializationWork(PackageRegistrationTasks packageRegistrationTasks)
public void RegisterInitializationWork(PackageLoadTasks packageInitializationTasks)
Copy link
Member

@jasonmalinowski jasonmalinowski Mar 20, 2025

Choose a reason for hiding this comment

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

Suggested change
public void RegisterInitializationWork(PackageLoadTasks packageInitializationTasks)
public void RegisterInitializationWork(PackageLoadTasks packageLoadTasks)

Maybe just to keep the naming consistent? Although I kinda like PackageInitializationTasks too...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to be consistent and keep all the RegisterInitializeAsyncWork method parameters to be named packageInitializationTasks and the RegisterOnAfterPackageLoadedAsyncWork parameters to be afterPackageLoadedTasks.

Comment on lines +192 to +193
// Ensure the options persisters are loaded since we have to fetch options from the shell
LoadOptionPersistersAsync(this.ComponentModel, cancellationToken).Forget();
Copy link
Member

Choose a reason for hiding this comment

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

This is still hopping back to the main thread for the PackageSettingsPersister, right? Will that cause any problems? I don't imagine so since you're still doing a JTF friendly await but I don't imagine we risk deadlock, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you point me to the main thread switch you're mentioning.

Copy link
Member

Choose a reason for hiding this comment

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

Oh never mind I was wrong it doesn't exist.

packageInitializationTasks.AddTask(
isMainThreadTask:=False,
task:=Function(progress, packageRegistrationTasks2, cancellationToken) As Task
task:=Function(packageInitializationTasks2, cancellationToken) As Task
Copy link
Member

Choose a reason for hiding this comment

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

Given the local you're calling this on is always in scope, do you really ever need this function param? We're not using static lambdas....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not a VB expert, I just type until something compiles for it. What's the suggested change?

Copy link
Member

Choose a reason for hiding this comment

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

Just delete the lambda parameter entirely in the function signature; it's already available as a local at all call sites so you're just making more typing generally.

@ToddGrun ToddGrun changed the base branch from release/dev18.0 to release/dev17.15 March 21, 2025 13:34
@ToddGrun ToddGrun closed this Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants