Skip to content

Document RequestContext access in placement and placement filtering#52473

Open
rkargMsft wants to merge 1 commit intodotnet:mainfrom
rkargMsft:patch-2
Open

Document RequestContext access in placement and placement filtering#52473
rkargMsft wants to merge 1 commit intodotnet:mainfrom
rkargMsft:patch-2

Conversation

@rkargMsft
Copy link
Contributor

@rkargMsft rkargMsft commented Mar 19, 2026

Added example code for accessing RequestContext data during placement filtering.

Summary

Example of accessing RequestContext from outside of a grain activation during placement or placement filtering.


Internal previews

📄 File 🔗 Preview link
docs/orleans/grains/request-context.md Request context

Added example code for accessing RequestContext data during placement filtering.
@dotnetrepoman dotnetrepoman bot added this to the March 2026 milestone Mar 19, 2026
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates PR is created by someone from the .NET community. label Mar 19, 2026

## Example placement access code

The <xref:Orleans.Runtime.RequestContext> data can be accessed during Placement or Placement Filtering through the <xref:Orleans.Runtime.Placement.PlacementTarget> `RequestContextData`. The static <xref:Orleans.Runtime.RequestContext> is not populated at this time as there is not yet an activation of the grain. The following placement filter code demonstrates how to get <xref:Orleans.Runtime.RequestContext> data while handling placement:
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
The <xref:Orleans.Runtime.RequestContext> data can be accessed during Placement or Placement Filtering through the <xref:Orleans.Runtime.Placement.PlacementTarget> `RequestContextData`. The static <xref:Orleans.Runtime.RequestContext> is not populated at this time as there is not yet an activation of the grain. The following placement filter code demonstrates how to get <xref:Orleans.Runtime.RequestContext> data while handling placement:
The <xref:Orleans.Runtime.RequestContext> data can be accessed during placement or placement filtering through the <xref:Orleans.Runtime.Placement.PlacementTarget> `RequestContextData`. The static <xref:Orleans.Runtime.RequestContext> is not populated at this time as there is not yet an activation of the grain. The following placement filter code demonstrates how to get <xref:Orleans.Runtime.RequestContext> data while handling placement:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants