You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Orleans Interceptors documentation it is specified at the end that "Grain-level interceptors will also be invoked for grain extensions (implementations of IGrainExtension), not only for method in the current class." What are those IGrainExtension implementations used for? How can they be registered to a grain?
The text was updated successfully, but these errors were encountered:
Grain extensions are a very cool feature. I learned the ins-and-outs of them while writing #1916.
Grain extensions are a way to attach behaviors to grains. It's basically the component pattern, or like a mixin.
For example, I attach an IObserverGrainExtension to a grain so that I can send OnNextAsync/etc calls to a grain which are then translated into calls to the observer object in the grain itself.
As another example, For Orleans.Consensus (a Raft implementation), we may end up adding an extension which implements the Raft RPCs so that individual grains can become replicated state machines without having to implement a distributed consensus algorithm themselves.
In the framework, IGrainExtension is currently used for Streams support and CancellationToken support.
Currently, grain extensions are not accessible from external code - they cannot be registered without having internal access to Orleans. #1916 includes a change which makes a new interface, IGrainExtensionManager accessible through DI - so grains would be able to take advantage of extensions.
In Orleans Interceptors documentation it is specified at the end that "Grain-level interceptors will also be invoked for grain extensions (implementations of IGrainExtension), not only for method in the current class." What are those IGrainExtension implementations used for? How can they be registered to a grain?
The text was updated successfully, but these errors were encountered: