Applying [Id] to methods - when? why? #8835
-
The |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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 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 |
Beta Was this translation helpful? Give feedback.
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")