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

Add wrapper service broker to allow for easy MEF consumption #75717

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

dibarbet
Copy link
Member

@dibarbet dibarbet commented Nov 4, 2024

We want to allow partners that run in our process to have easy access to the IServiceBroker so they can access services from devkit. Previously we provided access via an IVT OnServiceBrokerInitialized method. However there are a number of other assemblies that would also like access to the service broker instance, and we'd have to add IVTs for each one.

Unfortunately it is not straightforward to just mef export our IServiceBroker instance as it is only created after the mef composition is created.

To make this easier we create our own wrapper of IServiceBroker that we export via mef. The wrapper implementation waits for the brokered service to be available before delegating to the real instance.

@etvorun tested with xaml to confirm it can be consumed.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 4, 2024
@dibarbet dibarbet marked this pull request as ready for review November 4, 2024 21:32
@dibarbet dibarbet requested a review from a team as a code owner November 4, 2024 21:32
@dibarbet dibarbet merged commit 964269c into dotnet:main Nov 5, 2024
25 checks passed
@dibarbet dibarbet deleted the service_broker_mef branch November 5, 2024 18:38
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Nov 5, 2024
@jjonescz jjonescz modified the milestones: Next, 17.13 P2 Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants