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

Pluggable StreamId to GrainId mapper #6682

Merged
merged 4 commits into from
Aug 13, 2020

Conversation

benjaminpetit
Copy link
Member

No description provided.

@@ -121,6 +121,11 @@ public static class WellKnownGrainTypeProperties
/// </summary>
public const string StreamBindingIncludeNamespaceKey = "include-namespace";

/// <summary>
/// Key type of the grain, if it implement a legacy interface. Valid values are nameof(String), nameof(Int32) and nameof(Guid)
Copy link
Member

Choose a reason for hiding this comment

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

Should this be Int64?

/// <summary>
/// Get the corresponding GrainId from the StreamId
/// </summary>
GrainId GetGrainId(GrainBindings grainBindings, StreamId streamId);
Copy link
Member

Choose a reason for hiding this comment

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

I think ultimately a model which is compositional would be advantageous. Eg, TryGetGrainId, so you can run them in sequence before falling back to a default

}
var streamIdMapper = _serviceProvider.GetServiceByName<IStreamIdMapper>(string.IsNullOrWhiteSpace(mapperName) ? DefaultStreamIdMapper.Name : mapperName);
Copy link
Member

Choose a reason for hiding this comment

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

I think we should pass the default name through the grain bindings, rather than pass null/empty and map it here

Copy link
Member

@ReubenBond ReubenBond left a comment

Choose a reason for hiding this comment

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

One suggestion

@ReubenBond ReubenBond merged commit e486800 into dotnet:master Aug 13, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants