-
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
Allow IGrainWithGuidCompoundKey as implicit subscription grain #3011
Conversation
src/Orleans/Core/GrainExtensions.cs
Outdated
{ | ||
var key = grain.GetPrimaryKey(out string keyExtension); | ||
return new StreamIdentity(key, keyExtension); | ||
} |
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.
GrainExtention is not a good place to put this method, since this method is not commonly applicable to all grains. This method only applies to grains which subscribes to a stream implicitly.
{ | ||
logger.Info($"************************ {nameof(FilteredImplicitSubscriptionWithExtensionGrainTest)} *********************************"); | ||
|
||
var streamNamespaces = new[] { "red1", "red2", "blue3", "blue4" }; |
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.
why do you need this variable? it is not used in anywhere
src/Orleans/Core/GrainExtensions.cs
Outdated
|
||
public static StreamIdentity GetImplicitStreamIdentity(this IGrainWithGuidCompoundKey grain) | ||
{ | ||
var key = grain.GetPrimaryKey(out string keyExtension); |
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.
Compilation fails due to the use of this C# 7 feature here.
@dotnet-bot test netfx-functional please |
LG2M |
Breaking change note: GrainId for implicit subscribed consumer grain which implements IGrainWithGuidCompoundKey will change from stream.GuidId to stream.NameSpace + stream.GuidId. A workaround if you don't want this feature : make the consumer grain implements IGrainWithGuidKey breaking change note is here for better tracking breaking change. |
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.
LGTM
@@ -0,0 +1,12 @@ | |||
namespace Orleans.Streams | |||
{ | |||
public static class ImplicitConsumerGrainExtensions |
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.
do you need to add xml comments here? build your solution and fix warnings if any,
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.
@xiazen It wasn't giving warnings but I've added xml docs anyway.
Thanks @DixonDs ! will merge it after the test finished |
@dotnet-bot test netfx-functional please |
Per discussion in #2987