Search Results for

    Show / Hide Table of Contents

    Class ActorPath

    Actor path is a unique path to an actor that shows the creation path up through the actor tree to the root actor. ActorPath defines a natural ordering (so that ActorRefs can be put into collections with this requirement); this ordering is intended to be as fast as possible, which owing to the bottom-up recursive nature of ActorPath is sorted by path elements FROM RIGHT TO LEFT, where RootActorPath > ChildActorPath in case the number of elements is different. Two actor paths are compared equal when they have the same name and parent elements, including the root address information. That does not necessarily mean that they point to the same incarnation of the actor if the actor is re-created with the same path. In other words, in contrast to how actor references are compared the unique id of the actor is not taken into account when comparing actor paths.

    Inheritance
    object
    ActorPath
    ChildActorPath
    RootActorPath
    Implements
    IEquatable<ActorPath>
    IComparable<ActorPath>
    ISurrogated
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Akka.Actor
    Assembly: Akka.dll
    Syntax
    public abstract class ActorPath : IEquatable<ActorPath>, IComparable<ActorPath>, ISurrogated

    Constructors

    | Edit this page View Source

    ActorPath(ActorPath, string, long)

    Initializes a new instance of the ActorPath class as child.

    Declaration
    protected ActorPath(ActorPath parentPath, string name, long uid)
    Parameters
    Type Name Description
    ActorPath parentPath

    The parentPath.

    string name

    The name.

    long uid

    The uid.

    | Edit this page View Source

    ActorPath(Address, string)

    Initializes a new instance of the ActorPath class as root.

    Declaration
    protected ActorPath(Address address, string name)
    Parameters
    Type Name Description
    Address address

    The address.

    string name

    The name.

    Fields

    | Edit this page View Source

    ValidSymbols

    Declaration
    public const string ValidSymbols = "\"-_.*$+:@&=,!~';()"
    Field Value
    Type Description
    string

    Properties

    | Edit this page View Source

    Address

    The Address under which this path can be reached; walks up the tree to the RootActorPath.

    Declaration
    public Address Address { get; }
    Property Value
    Type Description
    Address

    The address.

    | Edit this page View Source

    Depth

    The the depth of the actor.

    Declaration
    public int Depth { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    Elements

    Gets the elements.

    Declaration
    public IReadOnlyList<string> Elements { get; }
    Property Value
    Type Description
    IReadOnlyList<string>

    The elements.

    | Edit this page View Source

    Name

    Gets the name.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    string

    The name.

    | Edit this page View Source

    Parent

    The path of the parent to this actor.

    Declaration
    public ActorPath Parent { get; }
    Property Value
    Type Description
    ActorPath
    | Edit this page View Source

    Root

    The root actor path.

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

    Uid

    Gets the uid.

    Declaration
    public long Uid { get; }
    Property Value
    Type Description
    long

    The uid.

    Methods

    | Edit this page View Source

    Child(string)

    Creates a child with the specified name

    Declaration
    public ActorPath Child(string childName)
    Parameters
    Type Name Description
    string childName

    Name of the child.

    Returns
    Type Description
    ActorPath

    ActorPath.

    | Edit this page View Source

    CompareTo(ActorPath)

    Declaration
    public int CompareTo(ActorPath other)
    Parameters
    Type Name Description
    ActorPath other
    Returns
    Type Description
    int
    | Edit this page View Source

    Equals(ActorPath)

    Declaration
    public bool Equals(ActorPath other)
    Parameters
    Type Name Description
    ActorPath other
    Returns
    Type Description
    bool
    | 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

    FormatPathElements(IEnumerable<string>)

    TBD

    Declaration
    public static string FormatPathElements(IEnumerable<string> pathElements)
    Parameters
    Type Name Description
    IEnumerable<string> pathElements

    TBD

    Returns
    Type Description
    string

    TBD

    | Edit this page View Source

    GetHashCode()

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

    IsValidPathElement(string)

    Method that checks if actor name conforms to RFC 2396, http://www.ietf.org/rfc/rfc2396.txt Note that AKKA JVM does not allow parenthesis ( ) but, according to RFC 2396 those are allowed, and since we use URL Encode to create valid actor names, we must allow them.

    Declaration
    public static bool IsValidPathElement(string s)
    Parameters
    Type Name Description
    string s

    The string to verify for conformity

    Returns
    Type Description
    bool

    True if the path element is valid

    | Edit this page View Source

    ParentOf(int)

    Returns a parent of depth 0: Root, 1: Guardian, ..., -1: Parent, -2: GrandParent

    Declaration
    public ActorPath ParentOf(int depth)
    Parameters
    Type Name Description
    int depth

    The parent depth, negative depth for reverse lookup

    Returns
    Type Description
    ActorPath
    | Edit this page View Source

    Parse(string)

    Creates an ActorPath from the specified path.

    Declaration
    public static ActorPath Parse(string path)
    Parameters
    Type Name Description
    string path

    The string representing a possible ActorPath

    Returns
    Type Description
    ActorPath

    A newly created ActorPath

    Exceptions
    Type Condition
    UriFormatException

    This exception is thrown if the given path cannot be parsed into an ActorPath.

    | Edit this page View Source

    ToSerializationFormat()

    TBD

    Declaration
    public string ToSerializationFormat()
    Returns
    Type Description
    string

    TBD

    | Edit this page View Source

    ToSerializationFormatWithAddress(Address)

    TBD

    Declaration
    public string ToSerializationFormatWithAddress(Address address)
    Parameters
    Type Name Description
    Address address

    TBD

    Returns
    Type Description
    string

    TBD

    | Edit this page View Source

    ToString()

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

    ToStringWithAddress()

    Generate String representation, with the address in the RootActorPath.

    Declaration
    public string ToStringWithAddress()
    Returns
    Type Description
    string

    System.String.

    | Edit this page View Source

    ToStringWithAddress(Address)

    Generate String representation, replacing the Address in the RootActorPath with the given one unless this path’s address includes host and port information.

    Declaration
    public string ToStringWithAddress(Address address)
    Parameters
    Type Name Description
    Address address

    The address.

    Returns
    Type Description
    string

    System.String.

    | Edit this page View Source

    ToStringWithUid()

    Returns a string representation of this instance including uid.

    Declaration
    public string ToStringWithUid()
    Returns
    Type Description
    string

    TBD

    | Edit this page View Source

    ToStringWithoutAddress()

    String representation of the path elements, excluding the address information. The elements are separated with "/" and starts with "/", e.g. "/user/a/b".

    Declaration
    public string ToStringWithoutAddress()
    Returns
    Type Description
    string

    System.String.

    | Edit this page View Source

    ToSurrogate(ActorSystem)

    Creates a surrogate representation of the current ActorPath.

    Declaration
    public ISurrogate ToSurrogate(ActorSystem system)
    Parameters
    Type Name Description
    ActorSystem system

    The actor system that references this actor path.

    Returns
    Type Description
    ISurrogate

    The surrogate representation of the current ActorPath.

    | Edit this page View Source

    TryParse(ActorPath, ReadOnlySpan<char>, out ActorPath)

    Tries to parse the uri, which should be a uri not containing protocol. For example "/user/my-actor"

    Declaration
    public static bool TryParse(ActorPath basePath, ReadOnlySpan<char> absoluteUri, out ActorPath actorPath)
    Parameters
    Type Name Description
    ActorPath basePath

    the base path, normaly a root path

    ReadOnlySpan<char> absoluteUri

    TBD

    ActorPath actorPath

    TBD

    Returns
    Type Description
    bool

    TBD

    | Edit this page View Source

    TryParse(ActorPath, string, out ActorPath)

    Tries to parse the uri, which should be a uri not containing protocol. For example "/user/my-actor"

    Declaration
    public static bool TryParse(ActorPath basePath, string absoluteUri, out ActorPath actorPath)
    Parameters
    Type Name Description
    ActorPath basePath

    the base path, normaly a root path

    string absoluteUri

    TBD

    ActorPath actorPath

    TBD

    Returns
    Type Description
    bool

    TBD

    | Edit this page View Source

    TryParse(string, out ActorPath)

    Tries to parse the uri, which should be a full uri, i.e containing protocol. For example "akka://System/user/my-actor"

    Declaration
    public static bool TryParse(string path, out ActorPath actorPath)
    Parameters
    Type Name Description
    string path

    TBD

    ActorPath actorPath

    TBD

    Returns
    Type Description
    bool

    TBD

    | Edit this page View Source

    TryParseAddress(string, out Address)

    Attempts to parse an Address from a stringified ActorPath.

    Declaration
    public static bool TryParseAddress(string path, out Address address)
    Parameters
    Type Name Description
    string path

    The string representation of the ActorPath.

    Address address

    If true, the parsed Address. Otherwise null.

    Returns
    Type Description
    bool

    true if the Address could be parsed, false otherwise.

    | Edit this page View Source

    TryParseAddress(string, out Address, out ReadOnlySpan<char>)

    Attempts to parse an Address from a stringified ActorPath.

    Declaration
    public static bool TryParseAddress(string path, out Address address, out ReadOnlySpan<char> absoluteUri)
    Parameters
    Type Name Description
    string path

    The string representation of the ActorPath.

    Address address

    If true, the parsed Address. Otherwise null.

    ReadOnlySpan<char> absoluteUri

    A ReadOnlySpan<T> containing the path following the address.

    Returns
    Type Description
    bool

    true if the Address could be parsed, false otherwise.

    | Edit this page View Source

    TryParseParts(ReadOnlySpan<char>, out ReadOnlySpan<char>, out ReadOnlySpan<char>)

    Attempts to parse an Address from a stringified ActorPath.

    Declaration
    public static bool TryParseParts(ReadOnlySpan<char> path, out ReadOnlySpan<char> address, out ReadOnlySpan<char> absoluteUri)
    Parameters
    Type Name Description
    ReadOnlySpan<char> path

    The string representation of the ActorPath.

    ReadOnlySpan<char> address

    A ReadOnlySpan<T> containing the address part.

    ReadOnlySpan<char> absoluteUri

    A ReadOnlySpan<T> containing the path following the address.

    Returns
    Type Description
    bool

    true if the path parts could be parsed, false otherwise.

    | Edit this page View Source

    WithUid(long)

    Creates a copy of the given ActorPath and applies a new Uid

    Declaration
    public ActorPath WithUid(long uid)
    Parameters
    Type Name Description
    long uid

    The uid.

    Returns
    Type Description
    ActorPath

    ActorPath.

    Operators

    | Edit this page View Source

    operator /(ActorPath, IEnumerable<string>)

    Creates a new ActorPath by appending all the names in name to the specified path.

    Declaration
    public static ActorPath operator /(ActorPath path, IEnumerable<string> name)
    Parameters
    Type Name Description
    ActorPath path

    The base path of the newly created actor path.

    IEnumerable<string> name

    The names being appended to the specified path.

    Returns
    Type Description
    ActorPath

    A newly created ActorPath

    | Edit this page View Source

    operator /(ActorPath, string)

    Creates a new ChildActorPath with the specified parent path and the specified name.

    Declaration
    public static ActorPath operator /(ActorPath path, string name)
    Parameters
    Type Name Description
    ActorPath path

    The parent path of the newly created actor path

    string name

    The name of child actor path

    Returns
    Type Description
    ActorPath

    A newly created ChildActorPath

    | Edit this page View Source

    operator ==(ActorPath, ActorPath)

    Compares two specified actor paths for equality.

    Declaration
    public static bool operator ==(ActorPath left, ActorPath right)
    Parameters
    Type Name Description
    ActorPath left

    The first actor path used for comparison

    ActorPath right

    The second actor path used for comparison

    Returns
    Type Description
    bool

    true if both actor paths are equal; otherwise false

    | Edit this page View Source

    operator !=(ActorPath, ActorPath)

    Compares two specified actor paths for inequality.

    Declaration
    public static bool operator !=(ActorPath left, ActorPath right)
    Parameters
    Type Name Description
    ActorPath left

    The first actor path used for comparison

    ActorPath right

    The second actor path used for comparison

    Returns
    Type Description
    bool

    true if both actor paths are not equal; otherwise false

    Implements

    IEquatable<T>
    IComparable<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