Skip to content

Applying [Id] to methods - when? why? #8835

Answered by ReubenBond
chwarr asked this question in Q&A
Discussion options

You must be logged in to vote

Good question. The answer is that grain methods are serialized, too, when the method is invoked (i.e, RPC). The Id in this case is used an alias to make method call serialization resilient to renames. Alternatively, you can use an [Alias(x)] on a method. We merged an analyzer/codefix to automate adding aliases to methods (it's a hint, not a warning).

A serializable class is generated for each method with fields for the method parameters. The invoker's type is identified on the wire using a tuple of the form ("inv", typeof(GrainReference), typeof(IMyInterface), "my-custom-method-id")

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chwarr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants