Standard Dependency Injection for Actors
See original GitHub issueDescribe the proposal
The ActorService should instantiate actors through the ASP.Net Core DI container and inject the ActorId through a property or method.
Yes I know that you can use actorRuntime.RegisterActor<DemoActor>( (type) => new ActorService(type, (actorService, actorId) => new DemoActor(actorService, actorId)));
But the problem IMHO is that at the place you register the actor there is AFAIK no easy way to access the ASP.Net Core DI container.
Maybe there is another way to make the actor instantiation play better with dependency injection. I’m open for discussion.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Akka.NET Dependency Injection Best Practices
DependencyInjection has become the de facto standard for how dependency ... We can easily create actors that depend on and dispose of these ......
Read more >Understanding Dependency Injection in .NET Core
Dependency Injection : this is a design pattern to implement Inversion of Control. It allows you to inject the concrete implementation of a...
Read more >Dependency Injection Best Practices for Akka.NET - YouTube
Best practices, patterns, and techniques for working with .NET dependency injection and Akka.NET actors via the Akka.
Read more >Dependency Injection
Dependency Injection is a design pattern that allows an external object to create dependencies for a dependent object. Thus, the creation and binding...
Read more >Dependency Injection with Akka actors : r/scala
Is there a standard concerning Akka Actors and Scala Classes? With Guice or Spring this would be quite boilerplate heavy, having to create ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@amanbha Are there plans to provide this built-in so that I don’t have to use this?
I’d love to just inject an ILogger to use.
@tmatev please see for DI with actors https://github.com/dapr/dotnet-sdk/issues/171