Class Props
This class represents a configuration object used in creating an actor.
It is immutable and thus thread-safe.
private Props props = Props.Empty();
private Props props = Props.Create(() => new MyActor(arg1, arg2));
private Props otherProps = props.WithDispatcher("dispatcher-id");
private Props otherProps = props.WithDeploy(deployment info);
Inherited Members
Namespace: Akka.Actor
Assembly: Akka.dll
Syntax
public class Props : IEquatable<Props>, ISurrogated
Constructors
| Improve this Doc View SourceProps()
Initializes a new instance of the Props class.
Declaration
protected Props()
Props(Deploy, Type, IEnumerable<Object>)
Initializes a new instance of the Props class.
Declaration
public Props(Deploy deploy, Type type, IEnumerable<object> args)
Parameters
Type | Name | Description |
---|---|---|
Deploy | deploy | The configuration used to deploy the actor. |
Type | type | The type of the actor to create. |
IEnumerable<Object> | args | The arguments needed to create the actor. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | This exception is thrown if Props is not instantiated with an actor type. |
Props(Deploy, Type, Object[])
Initializes a new instance of the Props class.
Declaration
public Props(Deploy deploy, Type type, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
Deploy | deploy | The configuration used to deploy the actor. |
Type | type | The type of the actor to create. |
Object[] | args | The arguments needed to create the actor. |
Exceptions
Type | Condition |
---|---|
ArgumentException | This exception is thrown if |
Props(Props)
Initializes a new instance of the Props class.
Declaration
protected Props(Props copy)
Parameters
Type | Name | Description |
---|---|---|
Props | copy | The object that is being cloned. |
Props(Type)
Initializes a new instance of the Props class.
Declaration
public Props(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type of the actor to create. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | This exception is thrown if Props is not instantiated with an actor type. |
Props(Type, SupervisorStrategy, IEnumerable<Object>)
Initializes a new instance of the Props class.
Declaration
public Props(Type type, SupervisorStrategy supervisorStrategy, IEnumerable<object> args)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type of the actor to create. |
SupervisorStrategy | supervisorStrategy | The supervisor strategy used to manage the actor. |
IEnumerable<Object> | args | The arguments needed to create the actor. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | This exception is thrown if Props is not instantiated with an actor type. |
Props(Type, SupervisorStrategy, Object[])
Initializes a new instance of the Props class.
Declaration
public Props(Type type, SupervisorStrategy supervisorStrategy, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type of the actor to create. |
SupervisorStrategy | supervisorStrategy | The supervisor strategy used to manage the actor. |
Object[] | args | The arguments needed to create the actor. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | This exception is thrown if Props is not instantiated with an actor type. |
Props(Type, Object[])
Initializes a new instance of the Props class.
Declaration
public Props(Type type, object[] args)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type of the actor to create. |
Object[] | args | The arguments needed to create the actor. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | This exception is thrown if Props is not instantiated with an actor type. |
Fields
| Improve this Doc View SourceNone
A pre-configured Props that doesn't create actors.
note
The value of this field is null.
Declaration
public static readonly Props None
Field Value
Type | Description |
---|---|
Props |
Properties
| Improve this Doc View SourceArguments
The arguments needed to create the actor.
Declaration
public object[] Arguments { get; }
Property Value
Type | Description |
---|---|
Object[] |
Deploy
The configuration used to deploy the actor.
Declaration
public Deploy Deploy { get; protected set; }
Property Value
Type | Description |
---|---|
Deploy |
Dispatcher
The dispatcher used in the deployment of the actor.
Declaration
[JsonIgnore]
public string Dispatcher { get; }
Property Value
Type | Description |
---|---|
String |
Empty
A pre-configured Props that creates an actor that doesn't respond to messages.
Declaration
public static Props Empty { get; }
Property Value
Type | Description |
---|---|
Props |
Mailbox
The mailbox used in the deployment of the actor.
Declaration
[JsonIgnore]
public string Mailbox { get; }
Property Value
Type | Description |
---|---|
String |
RouterConfig
The router used in the deployment of the actor.
Declaration
[JsonIgnore]
public RouterConfig RouterConfig { get; }
Property Value
Type | Description |
---|---|
RouterConfig |
SupervisorStrategy
The supervisor strategy used to manage the actor.
Declaration
public SupervisorStrategy SupervisorStrategy { get; protected set; }
Property Value
Type | Description |
---|---|
SupervisorStrategy |
Type
The type of the actor that is created.
Declaration
[JsonIgnore]
public Type Type { get; }
Property Value
Type | Description |
---|---|
Type |
TypeName
The assembly qualified name of the type of the actor that is created.
Declaration
public string TypeName { get; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceCopy()
Creates a copy of the current instance.
Declaration
protected virtual Props Copy()
Returns
Type | Description |
---|---|
Props | The newly created Props |
Create(Type, Object[])
Creates an actor of a specified type.
Declaration
public static Props Create(Type type, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type of the actor to create. |
Object[] | args | The arguments needed to create the actor. |
Returns
Type | Description |
---|---|
Props | The newly created Props. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Props must be instantiated with an actor type. |
Create<TActor>(SupervisorStrategy)
Creates an actor using a specified supervisor strategy.
Declaration
public static Props Create<TActor>(SupervisorStrategy supervisorStrategy)
where TActor : ActorBase, new()
Parameters
Type | Name | Description |
---|---|---|
SupervisorStrategy | supervisorStrategy | The supervisor strategy used to manage the actor. |
Returns
Type | Description |
---|---|
Props | The newly created Props. |
Type Parameters
Name | Description |
---|---|
TActor | The type of the actor to create. |
Create<TActor>(Expression<Func<TActor>>, SupervisorStrategy)
Creates an actor using a specified lambda expression.
Declaration
public static Props Create<TActor>(Expression<Func<TActor>> factory, SupervisorStrategy supervisorStrategy = null)
where TActor : ActorBase
Parameters
Type | Name | Description |
---|---|---|
Expression<Func<TActor>> | factory | The lambda expression used to create the actor. |
SupervisorStrategy | supervisorStrategy | Optional: The supervisor strategy used to manage the actor. |
Returns
Type | Description |
---|---|
Props | The newly created Props. |
Type Parameters
Name | Description |
---|---|
TActor | The type of the actor to create. |
Exceptions
Type | Condition |
---|---|
ArgumentException | The create function must be a 'new T (args)' expression |
Create<TActor>(Object[])
Creates an actor using the given arguments.
Declaration
public static Props Create<TActor>(params object[] args)
where TActor : ActorBase
Parameters
Type | Name | Description |
---|---|---|
Object[] | args | The arguments needed to create the actor. |
Returns
Type | Description |
---|---|
Props | The newly created Props. |
Type Parameters
Name | Description |
---|---|
TActor | The type of the actor to create. |
CreateBy(IIndirectActorProducer, Object[])
Creates an actor using a specified actor producer.
Declaration
public static Props CreateBy(IIndirectActorProducer producer, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
IIndirectActorProducer | producer | The actor producer that will be used to create the underlying actor.. |
Object[] | args | The arguments needed to create the actor. |
Returns
Type | Description |
---|---|
Props | The newly created Props. |
CreateBy<TProducer>(Object[])
Creates an actor using a specified actor producer.
Declaration
[Obsolete("Do not use this method. Call CreateBy(IIndirectActorProducer, params object[] args) instead")]
public static Props CreateBy<TProducer>(params object[] args)
where TProducer : class, IIndirectActorProducer
Parameters
Type | Name | Description |
---|---|---|
Object[] | args | The arguments needed to create the actor. |
Returns
Type | Description |
---|---|
Props | The newly created Props. |
Type Parameters
Name | Description |
---|---|
TProducer | The type of producer used to create the actor. |
Equals(Props)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(Props other)
Parameters
Type | Name | Description |
---|---|---|
Props | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
Boolean |
|
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj |
Returns
Type | Description |
---|---|
Boolean |
Overrides
| Improve this Doc View SourceGetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceNewActor()
Creates a new actor using the configured actor producer.
Declaration
public virtual ActorBase NewActor()
Returns
Type | Description |
---|---|
ActorBase | The newly created actor |
Exceptions
Type | Condition |
---|---|
TypeLoadException | This exception is thrown if there was an error creating an actor of type Type with the arguments from Arguments. |
ToSurrogate(ActorSystem)
Creates a surrogate representation of the current Props.
Declaration
public ISurrogate ToSurrogate(ActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system | The actor system that owns this router. |
Returns
Type | Description |
---|---|
ISurrogate | The surrogate representation of the current Props. |
WithDeploy(Deploy)
Creates a new Props with a given deployment configuration.
note
This method is immutable and returns a new instance of Props.
Declaration
public Props WithDeploy(Deploy deploy)
Parameters
Type | Name | Description |
---|---|---|
Deploy | deploy | The configuration used to deploy the actor. |
Returns
Type | Description |
---|---|
Props | A new Props with the provided |
WithDispatcher(String)
Creates a new Props with a given dispatcher
.
note
This method is immutable and returns a new instance of Props.
Declaration
public Props WithDispatcher(string dispatcher)
Parameters
Type | Name | Description |
---|---|---|
String | dispatcher | The dispatcher used when deploying the actor. |
Returns
Type | Description |
---|---|
Props | A new Props with the provided |
WithMailbox(String)
Creates a new Props with a given mailbox
.
note
This method is immutable and returns a new instance of Props.
Declaration
public Props WithMailbox(string mailbox)
Parameters
Type | Name | Description |
---|---|---|
String | mailbox | The mailbox used when deploying the actor. |
Returns
Type | Description |
---|---|
Props | A new Props with the provided |
WithRouter(RouterConfig)
Creates a new Props with a given router.
note
This method is immutable and returns a new instance of Props.
Declaration
public Props WithRouter(RouterConfig routerConfig)
Parameters
Type | Name | Description |
---|---|---|
RouterConfig | routerConfig | The router used when deploying the actor. |
Returns
Type | Description |
---|---|
Props | A new Props with the provided |
WithStashCapacity(Int32)
Creates a new Props with a given stash size.
note
This method is immutable and returns a new instance of Props.
Declaration
public Props WithStashCapacity(int stashCapacity)
Parameters
Type | Name | Description |
---|---|---|
Int32 | stashCapacity | The stash size to use when creating the actor. |
Returns
Type | Description |
---|---|
Props | A new Props with the provided stash size.. |
Remarks
If the actor doesn't use an IStash or if it uses an IWithUnboundedStash, then this setting will be ignored.
WithSupervisorStrategy(SupervisorStrategy)
Creates a new Props with a given supervisor strategy.
note
This method is immutable and returns a new instance of Props.
Declaration
public Props WithSupervisorStrategy(SupervisorStrategy supervisorStrategy)
Parameters
Type | Name | Description |
---|---|---|
SupervisorStrategy | supervisorStrategy | The supervisor strategy used to manage the actor. |
Returns
Type | Description |
---|---|
Props | A new Props with the provided |