Search Results for

    Show / Hide Table of Contents

    Class Props

    This class represents a configuration object used in creating an actor. It is immutable and thus thread-safe.

    <pre><code class="lang-csharp">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);</code></pre>
    
    Inheritance
    object
    Props
    TerminatedProps
    Implements
    IEquatable<Props>
    ISurrogated
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Actor
    Assembly: Akka.dll
    Syntax
    public class Props : IEquatable<Props>, ISurrogated

    Constructors

    | Edit this page View Source

    Props()

    Initializes a new instance of the Props class.

    Declaration
    protected Props()
    | Edit this page View Source

    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.

    | Edit this page View Source

    Props(Deploy, Type, params 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 type is an unknown actor producer.

    | Edit this page View Source

    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.

    | Edit this page View Source

    Props(Type)

    Initializes a new instance of the Props class.

    note

    Props configured in this way uses the Deploy deployer.

    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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    Props(Type, SupervisorStrategy, params 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.

    | Edit this page View Source

    Props(Type, object[])

    Initializes a new instance of the Props class.

    note

    Props configured in this way uses the Deploy deployer.

    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

    | Edit this page View Source

    None

    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

    | Edit this page View Source

    Arguments

    The arguments needed to create the actor.

    Declaration
    public object[] Arguments { get; }
    Property Value
    Type Description
    object[]
    | Edit this page View Source

    Deploy

    The configuration used to deploy the actor.

    Declaration
    public Deploy Deploy { get; protected set; }
    Property Value
    Type Description
    Deploy
    | Edit this page View Source

    Dispatcher

    The dispatcher used in the deployment of the actor.

    Declaration
    [JsonIgnore]
    public string Dispatcher { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    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
    | Edit this page View Source

    Mailbox

    The mailbox used in the deployment of the actor.

    Declaration
    [JsonIgnore]
    public string Mailbox { get; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    RouterConfig

    The router used in the deployment of the actor.

    Declaration
    [JsonIgnore]
    public RouterConfig RouterConfig { get; }
    Property Value
    Type Description
    RouterConfig
    | Edit this page View Source

    SupervisorStrategy

    The supervisor strategy used to manage the actor.

    Declaration
    public SupervisorStrategy SupervisorStrategy { get; protected set; }
    Property Value
    Type Description
    SupervisorStrategy
    | Edit this page View Source

    Type

    The type of the actor that is created.

    Declaration
    [JsonIgnore]
    public Type Type { get; }
    Property Value
    Type Description
    Type
    | Edit this page View Source

    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

    | Edit this page View Source

    Copy()

    Creates a copy of the current instance.

    Declaration
    protected virtual Props Copy()
    Returns
    Type Description
    Props

    The newly created Props

    | Edit this page View Source

    Create(Type, params 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.

    | Edit this page View Source

    CreateBy(IIndirectActorProducer, params 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.

    | Edit this page View Source

    CreateBy<TProducer>(params 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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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

    | Edit this page View Source

    Create<TActor>(params 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.

    | Edit this page View Source

    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
    bool

    true if the current object is equal to the other parameter; otherwise, false.

    | Edit this page View Source

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)
    | Edit this page View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()
    | Edit this page View Source

    NewActor()

    Creates a new actor using the configured actor producer. This method is only useful when called during actor creation by the ActorSystem.

    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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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 deploy.

    | Edit this page View Source

    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 dispatcher.

    | Edit this page View Source

    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 mailbox.

    | Edit this page View Source

    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 routerConfig.

    | Edit this page View Source

    WithStashCapacity(int)

    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
    int 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.

    | Edit this page View Source

    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 supervisorStrategy.

    Implements

    IEquatable<T>
    ISurrogated

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET