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
| Improve this Doc View SourceActorPath(ActorPath, String, Int64)
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. |
Int64 | 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
| Improve this Doc View SourceValidSymbols
Declaration
public const string ValidSymbols = "\"-_.*$+:@&=,!~';()"
Field Value
Type | Description |
---|---|
String |
Properties
| Improve this Doc 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 |
---|---|
Int32 |
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 |
---|---|
Int64 | The uid. |
Methods
| Improve this Doc 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 |
---|---|
Int32 |
Equals(ActorPath)
Declaration
public bool Equals(ActorPath other)
Parameters
Type | Name | Description |
---|---|---|
ActorPath | other |
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 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 |
---|---|
Int32 |
Overrides
| Improve this Doc 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 |
---|---|
Boolean | True if the path element is valid |
ParentOf(Int32)
Returns a parent of depth 0: Root, 1: Guardian, ..., -1: Parent, -2: GrandParent
Declaration
public ActorPath ParentOf(int depth)
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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
| Improve this Doc 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. |
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. |
ToStringWithUid()
Returns a string representation of this instance including uid.
Declaration
public string ToStringWithUid()
Returns
Type | Description |
---|---|
String | TBD |
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 |
System.ReadOnlySpan<Char> | absoluteUri | TBD |
ActorPath | actorPath | TBD |
Returns
Type | Description |
---|---|
Boolean | 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 |
---|---|
Boolean | 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 |
---|---|
Boolean | 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 |
---|---|
Boolean |
|
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 |
System.ReadOnlySpan<Char> | absoluteUri | A System.ReadOnlySpan<T> containing the path following the address. |
Returns
Type | Description |
---|---|
Boolean |
|
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 |
---|---|---|
System.ReadOnlySpan<Char> | path | The string representation of the ActorPath. |
System.ReadOnlySpan<Char> | address | A System.ReadOnlySpan<T> containing the address part. |
System.ReadOnlySpan<Char> | absoluteUri | A System.ReadOnlySpan<T> containing the path following the address. |
Returns
Type | Description |
---|---|
Boolean |
|
WithUid(Int64)
Creates a copy of the given ActorPath and applies a new Uid
Declaration
public ActorPath WithUid(long uid)
Parameters
Type | Name | Description |
---|---|---|
Int64 | uid | The uid. |
Returns
Type | Description |
---|---|
ActorPath | ActorPath. |
Operators
| Improve this Doc View SourceDivision(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 |
Division(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 |
Equality(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 |
---|---|
Boolean |
|
Inequality(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 |
---|---|
Boolean |
|