Search Results for

    Show / Hide Table of Contents

    Class ActorSelection

    This class represents a logical view of a section of an ActorSystem's tree of actors that allows for broadcasting of messages to that section.

    Inheritance
    object
    ActorSelection
    Implements
    ICanTell
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Akka.Actor
    Assembly: Akka.dll
    Syntax
    public class ActorSelection : ICanTell

    Constructors

    | Edit this page View Source

    ActorSelection()

    Initializes a new instance of the ActorSelection class.

    Declaration
    public ActorSelection()
    | Edit this page View Source

    ActorSelection(IActorRef, SelectionPathElement[])

    Initializes a new instance of the ActorSelection class.

    Declaration
    public ActorSelection(IActorRef anchor, SelectionPathElement[] path)
    Parameters
    Type Name Description
    IActorRef anchor

    The anchor.

    SelectionPathElement[] path

    The path.

    | Edit this page View Source

    ActorSelection(IActorRef, IEnumerable<string>)

    Initializes a new instance of the ActorSelection class.

    Declaration
    public ActorSelection(IActorRef anchor, IEnumerable<string> elements)
    Parameters
    Type Name Description
    IActorRef anchor

    The anchor.

    IEnumerable<string> elements

    The elements.

    | Edit this page View Source

    ActorSelection(IActorRef, string)

    Initializes a new instance of the ActorSelection class.

    Declaration
    public ActorSelection(IActorRef anchor, string path)
    Parameters
    Type Name Description
    IActorRef anchor

    The anchor.

    string path

    The path.

    Properties

    | Edit this page View Source

    Anchor

    Gets the anchor.

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

    Path

    Gets the elements.

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

    PathString

    A string representation of all of the elements in the ActorSelection path, starting with "/" and separated with "/".

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

    Methods

    | Edit this page View Source

    Equals(ActorSelection)

    Declaration
    protected bool Equals(ActorSelection other)
    Parameters
    Type Name Description
    ActorSelection 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

    GetHashCode()

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

    ResolveOne(TimeSpan)

    Resolves the IActorRef matching this selection. The result is returned as a Task that is completed with the IActorRef if such an actor exists. It is completed with failure ActorNotFoundException if no such actor exists or the identification didn't complete within the supplied timeout.

    Under the hood it talks to the actor to verify its existence and acquire its IActorRef

    Declaration
    public Task<IActorRef> ResolveOne(TimeSpan timeout)
    Parameters
    Type Name Description
    TimeSpan timeout

    The amount of time to wait while resolving the selection before terminating the operation and generating an error.

    Returns
    Type Description
    Task<IActorRef>

    A Task that will be completed with the IActorRef, if the actor was found. Otherwise it will be failed with an ActorNotFoundException.

    Exceptions
    Type Condition
    ActorNotFoundException

    This exception is thrown if no such actor exists or the identification didn't complete within the supplied timeout.

    | Edit this page View Source

    ResolveOne(TimeSpan, CancellationToken)

    Resolves the IActorRef matching this selection. The result is returned as a Task that is completed with the IActorRef if such an actor exists. It is completed with failure ActorNotFoundException if no such actor exists or the identification didn't complete within the supplied timeout.

    Under the hood it talks to the actor to verify its existence and acquire its IActorRef

    Declaration
    public Task<IActorRef> ResolveOne(TimeSpan timeout, CancellationToken ct)
    Parameters
    Type Name Description
    TimeSpan timeout

    The amount of time to wait while resolving the selection before terminating the operation and generating an error.

    CancellationToken ct

    The cancellation token that can be used to cancel the operation.

    Returns
    Type Description
    Task<IActorRef>

    A Task that will be completed with the IActorRef, if the actor was found. Otherwise it will be failed with an ActorNotFoundException.

    Exceptions
    Type Condition
    ActorNotFoundException

    This exception is thrown if no such actor exists or the identification didn't complete within the supplied timeout.

    | Edit this page View Source

    Tell(object, IActorRef)

    Sends a message to this ActorSelection.

    Declaration
    public void Tell(object message, IActorRef sender = null)
    Parameters
    Type Name Description
    object message

    The message to send

    IActorRef sender

    The actor that sent the message

    | Edit this page View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()

    Implements

    ICanTell

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Futures.Ask(ICanTell, object, TimeSpan?)
    Futures.Ask(ICanTell, object, TimeSpan?, CancellationToken)
    Futures.Ask(ICanTell, object, CancellationToken)
    Futures.Ask<T>(ICanTell, Func<IActorRef, object>, TimeSpan?, CancellationToken)
    Futures.Ask<T>(ICanTell, object, TimeSpan?)
    Futures.Ask<T>(ICanTell, object, TimeSpan?, CancellationToken)
    Futures.Ask<T>(ICanTell, object, CancellationToken)
    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