Skip to content

Track migration from ParameterResource.Value to IValueProvider.GetValueAsync and eventing API due to changes in dotnet/aspire#10354 #751

@davidfowl

Description

@davidfowl

Background

The recent changes in dotnet/aspire#10354 impact how parameters are accessed in the CommunityToolkit Aspire libraries. Specifically, blocking calls to ParameterResource.Value must be replaced with the asynchronous IValueProvider.GetValueAsync API (this was implicit before 9.4 but will be a public API afterwards).

Problem

  • Any blocking calls to ParameterResource.Value, especially in asynchronous pipeline methods like AfterEndpointsAllocatedAsync, risk deadlocking or blocking app host startup.
  • AfterEndpointsAllocatedAsync is slated for deprecation in Aspire 9.4.
  • There is an urgent need to refactor toolkit code to
    • Eliminate blocking calls
    • Move off AfterEndpointsAllocatedAsync and instead use the eventing API for endpoint resolution (ResourceEndpointsAllocated)

Action Items

  • Audit CommunityToolkit Aspire code for blocking calls to ParameterResource.Value
  • Replace blocking calls with IValueProvider.GetValueAsync OR use the ParameterResource instance directly in environment variables (this will defer resolution)
  • Identify and refactor usages of AfterEndpointsAllocatedAsync to use the eventing API
  • Test all affected APIs (e.g., DBGate) to ensure they function correctly with the new async pattern

References


If any APIs or code paths are found that are not compatible with the new async pattern or eventing API, please document them here and propose migration steps.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions