Class DIActorProducer
This class represents an actor creation strategy that uses dependency injection (DI) to resolve and instantiate actors based on their type.
Implements
Inherited Members
Namespace: Akka.DI.Core
Assembly: Akka.DI.Core.dll
Syntax
public class DIActorProducer : IIndirectActorProducer
Constructors
| Improve this Doc View SourceDIActorProducer(IDependencyResolver, Type)
Initializes a new instance of the DIActorProducer class.
Declaration
public DIActorProducer(IDependencyResolver dependencyResolver, Type actorType)
Parameters
Type | Name | Description |
---|---|---|
IDependencyResolver | dependencyResolver | The resolver used to resolve the given actor type. |
Type | actorType | The type of actor that this producer creates. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | This exception is thrown when either the specified |
Properties
| Improve this Doc View SourceActorType
Retrieves the type of the actor to produce.
Declaration
public Type ActorType { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
| Improve this Doc View SourceProduce()
Creates an actor based on the container's implementation specific actor factory.
Declaration
public ActorBase Produce()
Returns
Type | Description |
---|---|
ActorBase | An actor created by the container. |
Release(ActorBase)
Signals the container that it can release its reference to the actor.
Declaration
public void Release(ActorBase actor)
Parameters
Type | Name | Description |
---|---|---|
ActorBase | actor | The actor to remove from the container. |