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

Allow IGrainWithGuidCompoundKey as implicit subscription grain #3011

Merged
merged 4 commits into from
May 16, 2017

Conversation

DixonDs
Copy link
Contributor

@DixonDs DixonDs commented May 11, 2017

Per discussion in #2987

@xiazen xiazen self-requested a review May 11, 2017 23:48
{
var key = grain.GetPrimaryKey(out string keyExtension);
return new StreamIdentity(key, keyExtension);
}
Copy link
Contributor

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" };
Copy link
Contributor

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

@xiazen xiazen requested a review from jason-bragg May 12, 2017 00:35

public static StreamIdentity GetImplicitStreamIdentity(this IGrainWithGuidCompoundKey grain)
{
var key = grain.GetPrimaryKey(out string keyExtension);
Copy link
Member

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.

@xiazen
Copy link
Contributor

xiazen commented May 15, 2017

@dotnet-bot test netfx-functional please

@jason-bragg
Copy link
Contributor

LG2M

@xiazen
Copy link
Contributor

xiazen commented May 15, 2017

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.

Copy link
Contributor

@xiazen xiazen left a 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
Copy link
Contributor

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,

Copy link
Contributor Author

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.

@xiazen
Copy link
Contributor

xiazen commented May 16, 2017

Thanks @DixonDs ! will merge it after the test finished

@xiazen
Copy link
Contributor

xiazen commented May 16, 2017

@dotnet-bot test netfx-functional please

@xiazen xiazen merged commit 780a3d8 into dotnet:master May 16, 2017
@DixonDs DixonDs deleted the implicit-stream-key-ext branch May 16, 2017 19:56
@xiazen xiazen mentioned this pull request Jun 15, 2017
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants