Search Results for

    Show / Hide Table of Contents

    Interface IActorContext

    TBD

    Inherited Members
    IActorRefFactory.ActorOf(Props, string)
    IActorRefFactory.ActorSelection(ActorPath)
    IActorRefFactory.ActorSelection(string)
    ICanWatch.Watch(IActorRef)
    ICanWatch.WatchWith(IActorRef, object)
    ICanWatch.Unwatch(IActorRef)
    Namespace: Akka.Actor
    Assembly: Akka.dll
    Syntax
    public interface IActorContext : IActorRefFactory, ICanWatch

    Properties

    | Edit this page View Source

    Dispatcher

    The dispatcher this actor is running on

    Declaration
    MessageDispatcher Dispatcher { get; }
    Property Value
    Type Description
    MessageDispatcher
    | Edit this page View Source

    Parent

    Gets the IActorRef of the parent of the current actor.

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

    Props

    The Props used to originally create this IActorRef

    Declaration
    Props Props { get; }
    Property Value
    Type Description
    Props
    | Edit this page View Source

    ReceiveTimeout

    Gets the inactivity deadline timeout set using SetReceiveTimeout(TimeSpan?).

    Declaration
    TimeSpan? ReceiveTimeout { get; }
    Property Value
    Type Description
    TimeSpan?
    | Edit this page View Source

    Self

    Gets the IActorRef belonging to the current actor.

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

    Sender

    Gets the IActorRef of the actor who sent the current message.

    If the message was not sent by an actor (i.e. some external non-actor code sent this actor a message) then this value will default to NoSender.

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

    System

    Gets a reference to the ActorSystem to which this actor belongs.

    This property is how you can get access to the IScheduler and other parts of Akka.NET from within an actor instance.
    Declaration
    ActorSystem System { get; }
    Property Value
    Type Description
    ActorSystem

    Methods

    | Edit this page View Source

    Become(Receive)

    Changes the actor's behavior and replaces the current receive handler with the specified handler.

    Declaration
    void Become(Receive receive)
    Parameters
    Type Name Description
    Receive receive

    The new message handler.

    | Edit this page View Source

    BecomeStacked(Receive)

    Changes the actor's behavior and replaces the current receive handler with the specified handler. The current handler is stored on a stack, and you can revert to it by calling UnbecomeStacked() Please note, that in order to not leak memory, make sure every call to BecomeStacked(Receive) is matched with a call to UnbecomeStacked().

    Declaration
    void BecomeStacked(Receive receive)
    Parameters
    Type Name Description
    Receive receive

    The new message handler.

    | Edit this page View Source

    Child(string)

    Retrieves a child actor with the specified name, if it exists.

    If the child with the given name cannot be found, then Nobody will be returned instead.

    Declaration
    IActorRef Child(string name)
    Parameters
    Type Name Description
    string name

    The name of the child actor.

    e.g. "child1", "foo"

    Not the path, just the name of the child at the time it was created by this parent.

    Returns
    Type Description
    IActorRef

    The IActorRef belonging to the child if found, Nobody otherwise.

    | Edit this page View Source

    GetChildren()

    Gets all of the children that belong to this actor.

    If this actor has no children, an empty collection of IActorRef is returned instead.

    Declaration
    IEnumerable<IActorRef> GetChildren()
    Returns
    Type Description
    IEnumerable<IActorRef>

    TBD

    | Edit this page View Source

    SetReceiveTimeout(TimeSpan?)

    Defines the inactivity timeout after which the sending of a ReceiveTimeout message is triggered. When specified, the receive function should be able to handle a ReceiveTimeout message.

    Please note that the receive timeout might fire and enqueue the ReceiveTimeout message right after another message was enqueued; hence it is not guaranteed that upon reception of the receive timeout there must have been an idle period beforehand as configured via this method.

    Once set, the receive timeout stays in effect (i.e. continues firing repeatedly after inactivity periods). Pass in null to switch off this feature.

    Declaration
    void SetReceiveTimeout(TimeSpan? timeout)
    Parameters
    Type Name Description
    TimeSpan? timeout

    The timeout. Pass in null to switch off this feature.

    | Edit this page View Source

    Stop(IActorRef)

    Issues a stop command to the provided IActorRef, which will cause that actor to terminate.

    Declaration
    void Stop(IActorRef child)
    Parameters
    Type Name Description
    IActorRef child

    The actor who will be stopped.

    | Edit this page View Source

    UnbecomeStacked()

    Changes the actor's behavior and replaces the current receive handler with the previous one on the behavior stack. In order to store an actor on the behavior stack, a call to BecomeStacked(Receive) must have been made prior to this call

    Declaration
    void UnbecomeStacked()

    Extension Methods

    StashFactory.CreateStash(IActorContext, IActorStash)
    StashFactory.CreateStash(IActorContext, Type)
    StashFactory.CreateStash<T>(IActorContext)
    Logging.GetLogger(IActorContext, ILogMessageFormatter)
    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    ActorRefFactoryExtensions.ActorOf<TActor>(IActorRefFactory, string)
    ActorRefFactoryExtensions.ActorSelection(IActorRefFactory, IActorRef, string)
    ActExtensions.ActorOf(IActorRefFactory, Action<IActorDsl, IActorContext>, string)
    ActExtensions.ActorOf(IActorRefFactory, Action<IActorDsl>, string)
    ActorMaterializerExtensions.Materializer(IActorRefFactory, ActorMaterializerSettings, string)
    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