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 [RpcMarshalable] interfaces to declare properties with serialized values #952

Open
AArnott opened this issue Jul 26, 2023 · 4 comments

Comments

@AArnott
Copy link
Member

AArnott commented Jul 26, 2023

Some objects that are marshaled via their [RpcMarshalable] interface would like to include properties on that interface. Since all RPC members must be async and properties are not async, these properties would not invoke RPC. Rather, they would return values that were captured from the marshaled object at the time it was originally marshaled. Essentially, sending an object via a marshaled interface may include two parts: a serialized form of its declared properties, and the marshaled handle.

This could create a usability problem when receivers get an interface where the methods invoke RPC but properties return stale values from when they first received the object. We can mitigate this by making this opt-in on a per-interface basis. An interface with [RpcMarshalable, RpcSnapshotProperties] would make properties allowable, and also effectively communicate to the interface author and its users that the properties will retain only snapshotted values.

@AArnott
Copy link
Member Author

AArnott commented Jul 26, 2023

@matteo-prosperi What do you think? Feedback? Any interest in implementing this?

@matteo-prosperi
Copy link
Member

matteo-prosperi commented Jul 26, 2023 via email

@AArnott
Copy link
Member Author

AArnott commented Jul 26, 2023

I suppose rather than a new attribute we could add a property to the existing one.
I like the clean separation as well, but it has led to some awkward API changes being required in the VS copilot extension.

@matteo-prosperi
Copy link
Member

matteo-prosperi commented Jul 26, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants