Replies: 3 comments 2 replies
-
A benefit that I didn't mention in the description because it seems obvious to me, but maybe it's not that much and that's why I'll talk about it now, is that when defining a default method that returns only the current state of the actor, so this actor doesn't need to call any Host Function, because in this case, there is no computation involved in the data, just getting its value. This in turn avoids a round trip call from the network to the host function and makes this method allied with the fact that the actor's state is always retrieved, except at initialization, directly from fast access memory. |
Beta Was this translation helpful? Give feedback.
-
@eigr/core-team @eigr/contributors wdyt? |
Beta Was this translation helpful? Give feedback.
-
I try to understand. This is, a method implemented for the Actor in advance, hence a default. This is kind on protocol level as an actor could not access its proxy local state, this way the proxy knows about the semantics of getstate? |
Beta Was this translation helpful? Give feedback.
-
I propose creating default methods for actors.
My idea is that all actors automatically have methods to get values from the actor's state. That way users who want to implement methods just to get and/or set the state value don't need to code such methods, they would already exist by default.
Obviously this option could be optional and the definition of such methods could exist or not based on configuration so that this feature does not need to be changed in the SDKs.
The method names could be get_state and if the user is called by GetState or getState the system should understand these names as valid as well.
I think it's dangerous to provide a method to set an actor's state, but this might be another option if the user really wants such a method.
Beta Was this translation helpful? Give feedback.
All reactions