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

Started actors as objects with local and grid varieties. #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

VaughnVernon
Copy link
Contributor

@jakzal Please take a look. The idea is to make actors less conspicuous and to make sure that actors can be clearly created in the local-only Stage or in a Grid extension of Stage.

For the setting, we have some issues with actor serialization because some actors are being put on the grid that shouldn't be. See below. What follows is not only a nicer way to think of domain model actors as objects, it will also provide a simple fix for the serialization issues.

XOOM Starter codegen must be sure that vlingo-symbio-* storage actors are created locally, such that when an is serialized to distribute on the grid, the stores are not serialized. In other words, there must be an explicit distinction between local-only actors and those that belong on the grid. A simple rule is that any io.vlingo.lattice.model entity type is grid distributable. Other actors can be as well, but StateStore, Journal, ObjectStore, etc., must never be put on the grid.

Also I think there should be a very simple way to make the ObjectDescriptor use the ActorInstantiator. I noted your example use of the lambda/function () -> new SomeEntity(...). It would be great to introduce this approach into the ObjectDescriptor and ActorInstantiator. In that way we can make each new actor instance a matter of applying a function rather than instantiating a new specialized ActorInstantiator type; meaning that maybe we can use a general-purpose ActorInstantiator that can provide type-safe parameters for the function: () -> new SomeEntity(...)

These are really incomplete ideas because I haven't had time to experiment. In general, WDYT? Can you run with this?

/cc @danilo-ambrosio in the mean time we need to be sure that the Stage where StateStore, Journal, ObjectStore, etc., are created must be the local/default Stage and not the Grid. Perhaps a better way to put it is that only StatefulEntity, EventSourced, CommandSourced, various abstract Processes, and ObjectEntity extenders may be placed on the Grid.

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

Successfully merging this pull request may close these issues.

1 participant