Search Results for

    Show / Hide Table of Contents

    Class ActorBase

    Class ActorBase.

    Inheritance
    Object
    ActorBase
    EventStreamActor
    FSMBase
    GuardianActor
    SystemGuardianActor
    UntypedActor
    ShardRegion
    ClusterClient
    ClusterReceptionist
    FutureActor
    DeadLetterListener
    DefaultLogger
    InetAddressDnsResolver
    SimpleDnsManager
    BackoffSupervisorBase
    Eventsourced
    PersistencePluginProxy
    ReplayFilter
    WriteJournalBase
    SnapshotStore
    ActorPublisher<T>
    ActorSubscriber
    FanIn<T>
    StreamSupervisor
    InternalTestActor
    BlackHoleActor
    Implements
    IInternalActor
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Akka.Actor
    Assembly: Akka.dll
    Syntax
    public abstract class ActorBase : IInternalActor

    Constructors

    | Improve this Doc View Source

    ActorBase()

    Initializes a new instance of the ActorBase class.

    Declaration
    protected ActorBase()
    Exceptions
    Type Condition
    ActorInitializationException

    This exception is thrown when an actor is created using new. Always create actors using an ActorContext/System.

    Properties

    | Improve this Doc View Source

    Context

    Gets the context.

    Declaration
    protected static IActorContext Context { get; }
    Property Value
    Type Description
    IActorContext

    The context.

    Exceptions
    Type Condition
    NotSupportedException

    This exception is thrown if there is no active Context. The most likely cause is due to use of async operations from within this actor.

    | Improve this Doc View Source

    EmptyReceive

    EmptyReceive is a Receive-delegate that matches no messages at all, ever.

    Declaration
    protected static Receive EmptyReceive { get; }
    Property Value
    Type Description
    Receive
    | Improve this Doc View Source

    Self

    Gets the self ActorRef

    Declaration
    protected IActorRef Self { get; }
    Property Value
    Type Description
    IActorRef

    Self ActorRef

    | Improve this Doc View Source

    Sender

    Gets the sending ActorRef of the current message

    Declaration
    protected IActorRef Sender { get; }
    Property Value
    Type Description
    IActorRef

    The sender ActorRef

    Methods

    | Improve this Doc View Source

    AroundPostRestart(Exception, Object)

    Can be overridden to intercept calls to PostRestart. Calls PostRestart by default.

    Declaration
    public virtual void AroundPostRestart(Exception cause, object message)
    Parameters
    Type Name Description
    Exception cause

    The cause.

    Object message

    The message.

    | Improve this Doc View Source

    AroundPostStop()

    Can be overridden to intercept calls to PostStop. Calls PostStop by default..

    Declaration
    public virtual void AroundPostStop()
    | Improve this Doc View Source

    AroundPreRestart(Exception, Object)

    Can be overridden to intercept calls to PreRestart. Calls PreRestart by default.

    Declaration
    public virtual void AroundPreRestart(Exception cause, object message)
    Parameters
    Type Name Description
    Exception cause

    The cause.

    Object message

    The message.

    | Improve this Doc View Source

    AroundPreStart()

    Can be overridden to intercept calls to PreStart. Calls PreStart by default.

    Declaration
    public virtual void AroundPreStart()
    | Improve this Doc View Source

    AroundReceive(Receive, Object)

    TBD

    Declaration
    protected virtual bool AroundReceive(Receive receive, object message)
    Parameters
    Type Name Description
    Receive receive

    TBD

    Object message

    TBD

    Returns
    Type Description
    Boolean

    TBD

    | Improve this Doc View Source

    Become(Receive)

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

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

    The new message handler.

    | Improve this Doc 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
    protected void BecomeStacked(Receive receive)
    Parameters
    Type Name Description
    Receive receive

    The new message handler.

    | Improve this Doc View Source

    PostRestart(Exception)

    User overridable callback: By default it calls PreStart().

    Is called right AFTER restart on the newly created Actor to allow reinitialization after an Actor crash.

    Declaration
    protected virtual void PostRestart(Exception reason)
    Parameters
    Type Name Description
    Exception reason

    the Exception that caused the restart to happen.

    | Improve this Doc View Source

    PostStop()

    User overridable callback.

    Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.

    Declaration
    protected virtual void PostStop()
    | Improve this Doc View Source

    PreRestart(Exception, Object)

    User overridable callback: '''By default it disposes of all children and then calls postStop().'''

    Is called on a crashed Actor right BEFORE it is restarted to allow clean up of resources before Actor is terminated.

    Declaration
    protected virtual void PreRestart(Exception reason, object message)
    Parameters
    Type Name Description
    Exception reason

    the Exception that caused the restart to happen.

    Object message

    optionally the current message the actor processed when failing, if applicable.

    | Improve this Doc View Source

    PreStart()

    User overridable callback.

    Is called when an Actor is started. Actors are automatically started asynchronously when created. Empty default implementation.

    Declaration
    protected virtual void PreStart()
    | Improve this Doc View Source

    Receive(Object)

    Processor for user defined messages.

    Declaration
    protected abstract bool Receive(object message)
    Parameters
    Type Name Description
    Object message

    The message.

    Returns
    Type Description
    Boolean

    TBD

    | Improve this Doc View Source

    SetReceiveTimeout(Nullable<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
    protected void SetReceiveTimeout(TimeSpan? timeout)
    Parameters
    Type Name Description
    Nullable<TimeSpan> timeout

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

    | Improve this Doc View Source

    SupervisorStrategy()

    TBD

    Declaration
    protected virtual SupervisorStrategy SupervisorStrategy()
    Returns
    Type Description
    SupervisorStrategy

    TBD

    | Improve this Doc View Source

    UnbecomeStacked()

    Reverts the Actor behavior to the previous one on the behavior stack.

    Declaration
    protected void UnbecomeStacked()
    | Improve this Doc View Source

    Unhandled(Object)

    Is called when a message isn't handled by the current behavior of the actor by default it fails with either a DeathPactException (in case of an unhandled Terminated message) or publishes an UnhandledMessage to the actor's system's EventStream

    Declaration
    protected virtual void Unhandled(object message)
    Parameters
    Type Name Description
    Object message

    The unhandled message.

    Exceptions
    Type Condition
    DeathPactException

    This exception is thrown if the given message is a Terminated message.

    Explicit Interface Implementations

    | Improve this Doc View Source

    IInternalActor.ActorContext

    Gets the context.

    Declaration
    IActorContext IInternalActor.ActorContext { get; }
    Returns
    Type Description
    IActorContext

    The context.

    Exceptions
    Type Condition
    NotSupportedException

    This exception is thrown if there is no active ActorContext. The most likely cause is due to use of async operations from within this actor.

    Implements

    IInternalActor

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(Object)
    In This Article
    • githubImprove this Doc
    • 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