-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Props methods for propagating and setting IActorProducer are pretty weird #3599
Labels
Milestone
Comments
Going to put this into the v1.4.0 branch, since this will probably require an update to all of the Akka.DI.* plugins. |
This was referenced Mar 16, 2021
Aaronontheweb
added a commit
to Aaronontheweb/akka.net
that referenced
this issue
Mar 17, 2021
…ctorProducer dependencies more explicit
Arkatufus
pushed a commit
that referenced
this issue
Mar 18, 2021
* full reformat of Props class * refactor DefaultProducer * close #3599 - cleaned up Props methods to make IIndirectorActorProducer dependencies more explicit * close #4854 - removed and replaced ServiceProviderProps * API approval * added comment to clarify important backwards-compat change * fix regression on Props.Create<T> * eliminate one more source of reflection * fixed SupervisorStrategy copying * added specs to validate that Akka.DependencyInjection Props propagate values correctly * fixed Props copy error
This was referenced Mar 23, 2021
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Akka.NET Version: v1.3.9
This is how we set the
ActorProducer
insideProps
today when we're using dependency injection:akka.net/src/core/Akka/Actor/Props.cs
Lines 292 to 298 in 3c6115e
It's indirect, and we repeat this process of using reflection on the input type to figure out if we should use a custom
ActorProducer
whenever someone calls any of the fluent interface methods onProps
, all of which end up calling theProps.Copy()
method:akka.net/src/core/Akka/Actor/Props.cs
Lines 583 to 586 in 3c6115e
I'm not sure why we designed it this way, but it's gross, relies on magic, and not all that extensible. What irks me most about it is that the
Type
we feed intoProps
can mean different things other than the actor's implementation. I'd rather change the signatures onProps
to make it 100% explicit "I AM USING THIS PRODUCER" and not let the arguments of variousProps
constructors take on different meanings for the same input.How we do this without breaking 100% of existing DI plugins for Akka.NET is an interesting question. I guess a reasonable way of handling that is just "upgrade all of them" since this change doesn't have a meaningful impact on end-user code today, but it would break binary compatibility since fixing this issue might end up changing either the signatures of existing
Props
methods or changing their meanings. That doesn't seem like a big deal.The text was updated successfully, but these errors were encountered: