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

There is no way to configure local deployment via HOCON #4596

Closed
IgorFedchenko opened this issue Oct 29, 2020 · 3 comments
Closed

There is no way to configure local deployment via HOCON #4596

IgorFedchenko opened this issue Oct 29, 2020 · 3 comments

Comments

@IgorFedchenko
Copy link
Contributor

There is a Props.WithDeploy(...) method to set deployment with code, and we can do .WithDeploy(Deploy.Local) to configure local deployment.

We have serialize-creators option that allows to make sure all props are serializable. And, as noted in this option docs, we can ignore props that are not going to be deployed remotely, via deploy.scope = LocalScope setting.

So, there are use cases, when we need to be able to explicitly set deployment as local for some actor's props, but there is no way to do that via configuration - Deploy object configuration parsing does not support this, it's scope is always set to Deploy.NoScopeGiven:

var deploy = new Deploy(key, deployment, router, Deploy.NoScopeGiven, dispatcher, mailbox);

We should add support for deploy.scope there (with LocalScope and NoScopeGiven values to specify). or something like that. And update serialize-creators option comment to point to the place where/how exactly this local scope can be configured.

@Aaronontheweb
Copy link
Member

Copying what I wrote in Gitter chat about this issue:

is what you need a work-around for being able to mark an actor as "don't serialize my props when serialize-all-creators is on?"
or is there a bigger structural bug with Akka.NET's serialize-all-creators option?
if it's the first issue, believe there is a marker interface we can use that will tell Akka.NET to skip this actor
if it's the second issue, we should definitely add it to the current sprint
could you help me understand that @IgorFedchenko ?

@Aaronontheweb
Copy link
Member

So this is a pretty rare edge case:

  1. Want to run with serialize-creators = on;
  2. Don't have the ability to access the Props of the instantiated actor directly, and those Props include non-serializable constructor arguments;
  3. Need to try to influence that behavior via HOCON since the ActorOf callsite can't be directly modified by the consumer.

@Aaronontheweb
Copy link
Member

I'll leave it open in case it's more common than previously assumed - but giving it the "won't fix" label for now.

@IgorFedchenko IgorFedchenko changed the title There is not way to configure local deployment via HOCON There is no way to configure local deployment via HOCON Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants