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.
Inherited Members
Namespace: Akka.Actor
Assembly: Akka.dll
Syntax
public abstract class ActorPath : IEquatable<ActorPath>, IComparable<ActorPath>, ISurrogated
Constructors
| Edit this page View SourceActorPath(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. |
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 SourceValidSymbols
Declaration
public const string ValidSymbols = "\"-_.*$+:@&=,!~';()"
Field Value
| Type | Description |
|---|---|
| string |
Properties
| Edit this page View SourceAddress
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. |
Depth
The the depth of the actor.
Declaration
public int Depth { get; }
Property Value
| Type | Description |
|---|---|
| int |
Elements
Gets the elements.
Declaration
public IReadOnlyList<string> Elements { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> | The elements. |
Name
Gets the name.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string | The name. |
Parent
The path of the parent to this actor.
Declaration
public ActorPath Parent { get; }
Property Value
| Type | Description |
|---|---|
| ActorPath |
Root
The root actor path.
Declaration
[JsonIgnore]
public ActorPath Root { get; }
Property Value
| Type | Description |
|---|---|
| ActorPath |
Uid
Gets the uid.
Declaration
public long Uid { get; }
Property Value
| Type | Description |
|---|---|
| long | The uid. |
Methods
| Edit this page View SourceChild(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. |
CompareTo(ActorPath)
Declaration
public int CompareTo(ActorPath other)
Parameters
| Type | Name | Description |
|---|---|---|
| ActorPath | other |
Returns
| Type | Description |
|---|---|
| int |
Equals(ActorPath)
Declaration
public bool Equals(ActorPath other)
Parameters
| Type | Name | Description |
|---|---|---|
| ActorPath | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
| Edit this page View SourceFormatPathElements(IEnumerable<string>)
TBD
Declaration
public static string FormatPathElements(IEnumerable<string> pathElements)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | pathElements | TBD |
Returns
| Type | Description |
|---|---|
| string | TBD |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
Overrides
| Edit this page View SourceIsValidPathElement(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 |
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 |
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 |
ToSerializationFormat()
TBD
Declaration
public string ToSerializationFormat()
Returns
| Type | Description |
|---|---|
| string | TBD |
ToSerializationFormatWithAddress(Address)
TBD
Declaration
public string ToSerializationFormatWithAddress(Address address)
Parameters
| Type | Name | Description |
|---|---|---|
| Address | address | TBD |
Returns
| Type | Description |
|---|---|
| string | TBD |
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
| Edit this page View SourceToStringWithAddress()
Generate String representation, with the address in the RootActorPath.
Declaration
public string ToStringWithAddress()
Returns
| Type | Description |
|---|---|
| string | System.String. |
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. |
ToStringWithUid()
Returns a string representation of this instance including uid.
Declaration
public string ToStringWithUid()
Returns
| Type | Description |
|---|---|
| string | TBD |
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. |
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. |
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 |
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 |
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 |
TryParseAddress(string, out Address)
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 |
Returns
| Type | Description |
|---|---|
| bool |
|
TryParseAddress(string, out Address, out ReadOnlySpan<char>)
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 |
| ReadOnlySpan<char> | absoluteUri | A ReadOnlySpan<T> containing the path following the address. |
Returns
| Type | Description |
|---|---|
| bool |
|
TryParseParts(ReadOnlySpan<char>, out ReadOnlySpan<char>, out ReadOnlySpan<char>)
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 |
|
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 Sourceoperator /(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 |
Returns
| Type | Description |
|---|---|
| ActorPath | A newly created ActorPath |
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 |
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 |
|
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 |
|
Edit this page