-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Pluggable StreamId to GrainId mapper #6682
Conversation
@@ -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) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One suggestion
No description provided.