Class ActorCell
INTERNAL API.
The hosting infrastructure for actors.
Inherited Members
Namespace: Akka.Actor
Assembly: Akka.dll
Syntax
public class ActorCell : IUntypedActorContext, IActorContext, IActorRefFactory, ICanWatch, ICell
Constructors
| Improve this Doc View SourceActorCell(ActorSystemImpl, IInternalActorRef, Props, MessageDispatcher, IInternalActorRef)
TBD
Declaration
public ActorCell(ActorSystemImpl system, IInternalActorRef self, Props props, MessageDispatcher dispatcher, IInternalActorRef parent)
Parameters
Type | Name | Description |
---|---|---|
ActorSystemImpl | system | TBD |
Akka.Actor.IInternalActorRef | self | TBD |
Props | props | TBD |
MessageDispatcher | dispatcher | TBD |
Akka.Actor.IInternalActorRef | parent | TBD |
Fields
| Improve this Doc View SourceUndefinedUid
Constant placeholder value for actors without a defined unique identifier.
Declaration
public const int UndefinedUid = 0
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceChildrenContainer
The child container collection, used to house information about all child actors.
Declaration
public IChildrenContainer ChildrenContainer { get; }
Property Value
Type | Description |
---|---|
IChildrenContainer |
CurrentEnvelopeId
TBD
Declaration
public int CurrentEnvelopeId { get; }
Property Value
Type | Description |
---|---|
Int32 |
CurrentMessage
TBD
Declaration
public object CurrentMessage { get; }
Property Value
Type | Description |
---|---|
Object |
Dispatcher
TBD
Declaration
public MessageDispatcher Dispatcher { get; }
Property Value
Type | Description |
---|---|
MessageDispatcher |
HasMessages
TBD
Declaration
public bool HasMessages { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsLocal
TBD
Declaration
public bool IsLocal { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsNormal
TBD
Declaration
protected bool IsNormal { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsTerminated
TBD
Declaration
public bool IsTerminated { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsTerminating
TBD
Declaration
protected bool IsTerminating { get; }
Property Value
Type | Description |
---|---|
Boolean |
Mailbox
TBD
Declaration
public Mailbox Mailbox { get; }
Property Value
Type | Description |
---|---|
Mailbox |
NumberOfMessages
TBD
Declaration
public int NumberOfMessages { get; }
Property Value
Type | Description |
---|---|
Int32 |
Parent
TBD
Declaration
public IInternalActorRef Parent { get; }
Property Value
Type | Description |
---|---|
Akka.Actor.IInternalActorRef |
Props
TBD
Declaration
public Props Props { get; }
Property Value
Type | Description |
---|---|
Props |
ReceiveTimeout
TBD
Declaration
public TimeSpan? ReceiveTimeout { get; }
Property Value
Type | Description |
---|---|
Nullable<TimeSpan> |
Self
TBD
Declaration
public IActorRef Self { get; }
Property Value
Type | Description |
---|---|
IActorRef |
Sender
TBD
Declaration
public IActorRef Sender { get; }
Property Value
Type | Description |
---|---|
IActorRef |
System
TBD
Declaration
public ActorSystem System { get; }
Property Value
Type | Description |
---|---|
ActorSystem |
SystemImpl
TBD
Declaration
public ActorSystemImpl SystemImpl { get; }
Property Value
Type | Description |
---|---|
ActorSystemImpl |
TaskScheduler
TBD
Declaration
public virtual ActorTaskScheduler TaskScheduler { get; }
Property Value
Type | Description |
---|---|
ActorTaskScheduler |
Methods
| Improve this Doc View SourceActorOf(Props, String)
TBD
Declaration
public virtual IActorRef ActorOf(Props props, string name = null)
Parameters
Type | Name | Description |
---|---|---|
Props | props | TBD |
String | name | TBD |
Returns
Type | Description |
---|---|
IActorRef | TBD |
Exceptions
Type | Condition |
---|---|
InvalidActorNameException | This exception is thrown if the given |
ArgumentException | This exception is thrown if a pre-creation serialization occurred. |
InvalidOperationException | This exception is thrown if the actor tries to create a child while it is terminating or is terminated. |
ActorSelection(ActorPath)
TBD
Declaration
public ActorSelection ActorSelection(ActorPath path)
Parameters
Type | Name | Description |
---|---|---|
ActorPath | path | TBD |
Returns
Type | Description |
---|---|
ActorSelection | TBD |
ActorSelection(String)
TBD
Declaration
public ActorSelection ActorSelection(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path | TBD |
Returns
Type | Description |
---|---|
ActorSelection | TBD |
AddressTerminated(Address)
TBD
Declaration
protected void AddressTerminated(Address address)
Parameters
Type | Name | Description |
---|---|---|
Address | address | TBD |
AddWatcher(IActorRef, IActorRef)
TBD
Declaration
protected void AddWatcher(IActorRef watchee, IActorRef watcher)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | watchee | TBD |
IActorRef | watcher | TBD |
AttachChild(Props, Boolean, String)
Attaches a child to the current ActorCell.
This method is used in the process of starting actors.
Declaration
public virtual IActorRef AttachChild(Props props, bool isSystemService, string name = null)
Parameters
Type | Name | Description |
---|---|---|
Props | props | The Props this child actor will use. |
Boolean | isSystemService | If |
String | name | The name of the actor being started. Can be |
Returns
Type | Description |
---|---|
IActorRef | A reference to the initialized child actor. |
Exceptions
Type | Condition |
---|---|
InvalidActorNameException | This exception is thrown if the given |
ArgumentException | This exception is thrown if a pre-creation serialization occurred. |
InvalidOperationException | This exception is thrown if the actor tries to create a child while it is terminating or is terminated. |
AutoReceiveMessage(Envelope)
TBD
Declaration
protected virtual void AutoReceiveMessage(Envelope envelope)
Parameters
Type | Name | Description |
---|---|---|
Envelope | envelope | TBD |
Exceptions
Type | Condition |
---|---|
ActorKilledException | This exception is thrown if a Kill message is included in the given |
Become(Receive)
TBD
Declaration
public void Become(Receive receive)
Parameters
Type | Name | Description |
---|---|---|
Receive | receive | TBD |
BecomeStacked(Receive)
TBD
Declaration
public void BecomeStacked(Receive receive)
Parameters
Type | Name | Description |
---|---|---|
Receive | receive | TBD |
CheckReceiveTimeout(Boolean)
TBD
Declaration
public void CheckReceiveTimeout(bool reschedule = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | reschedule |
ClearActor(ActorBase)
TBD
Declaration
protected void ClearActor(ActorBase actor)
Parameters
Type | Name | Description |
---|---|---|
ActorBase | actor | TBD |
ClearActorCell()
TBD
Declaration
protected void ClearActorCell()
CreateNewActorInstance()
TBD
Declaration
protected virtual ActorBase CreateNewActorInstance()
Returns
Type | Description |
---|---|
ActorBase | TBD |
GetChildByName(String)
Obsolete. Use TryGetChildStatsByName(String, out IChildStats) instead.
Declaration
[Obsolete("Use TryGetChildStatsByName [0.7.1]", true)]
public IInternalActorRef GetChildByName(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | N/A |
Returns
Type | Description |
---|---|
Akka.Actor.IInternalActorRef | N/A |
GetChildren()
TBD
Declaration
public IEnumerable<IInternalActorRef> GetChildren()
Returns
Type | Description |
---|---|
IEnumerable<Akka.Actor.IInternalActorRef> | TBD |
GetCurrentSelfOrNoSender()
TBD
Declaration
public static IActorRef GetCurrentSelfOrNoSender()
Returns
Type | Description |
---|---|
IActorRef | TBD |
GetCurrentSenderOrNoSender()
TBD
Declaration
public static IActorRef GetCurrentSenderOrNoSender()
Returns
Type | Description |
---|---|
IActorRef | TBD |
GetSingleChild(String)
Get a single child matching the name supplied
Declaration
public IInternalActorRef GetSingleChild(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | the child's name |
Returns
Type | Description |
---|---|
Akka.Actor.IInternalActorRef | IInternalActorRef |
Init(Boolean, MailboxType)
Initialize this cell, i.e. set up mailboxes and supervision. The UID must be reasonably different from the previous UID of a possible actor with the same path, which can be achieved by using ThreadLocalRandom
Declaration
public void Init(bool sendSupervise, MailboxType mailboxType)
Parameters
Type | Name | Description |
---|---|---|
Boolean | sendSupervise | TBD |
MailboxType | mailboxType | TBD |
InitChild(IInternalActorRef)
This should only be used privately or when creating the root actor.
Declaration
public ChildRestartStats InitChild(IInternalActorRef actor)
Parameters
Type | Name | Description |
---|---|---|
Akka.Actor.IInternalActorRef | actor | TBD |
Returns
Type | Description |
---|---|
ChildRestartStats | TBD |
Invoke(Envelope)
Invokes the specified envelope.
Declaration
public void Invoke(Envelope envelope)
Parameters
Type | Name | Description |
---|---|---|
Envelope | envelope | The envelope. |
Exceptions
Type | Condition |
---|---|
ActorKilledException | This exception is thrown if a Kill message is included in the given |
PrepareForNewActor()
TBD
Declaration
protected void PrepareForNewActor()
PreStart()
Allow extra pre-start initialization in derived classes
Declaration
protected virtual void PreStart()
ReceivedTerminated(Terminated)
TBD
Declaration
protected void ReceivedTerminated(Terminated t)
Parameters
Type | Name | Description |
---|---|---|
Terminated | t | TBD |
ReceiveMessage(Object)
Receives the next message from the mailbox and feeds it to the underlying actor instance.
Declaration
protected virtual void ReceiveMessage(object message)
Parameters
Type | Name | Description |
---|---|---|
Object | message | The message that will be sent to the actor. |
ReceiveMessageForTest(Envelope)
This is only intended to be called from TestKit's TestActorRef
Declaration
public void ReceiveMessageForTest(Envelope envelope)
Parameters
Type | Name | Description |
---|---|---|
Envelope | envelope | TBD |
RemoveChildAndGetStateChange(IActorRef)
TBD
Declaration
protected SuspendReason RemoveChildAndGetStateChange(IActorRef child)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | child | TBD |
Returns
Type | Description |
---|---|
SuspendReason | TBD |
RemWatcher(IActorRef, IActorRef)
TBD
Declaration
protected void RemWatcher(IActorRef watchee, IActorRef watcher)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | watchee | TBD |
IActorRef | watcher | TBD |
ReserveChild(String)
TBD
Declaration
public void ReserveChild(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | TBD |
Restart(Exception)
Restarts the specified cause.
Declaration
public void Restart(Exception cause)
Parameters
Type | Name | Description |
---|---|---|
Exception | cause | The cause. |
Remarks
➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅
Resume(Exception)
Resumes the specified caused by failure.
Declaration
public void Resume(Exception causedByFailure)
Parameters
Type | Name | Description |
---|---|---|
Exception | causedByFailure | The caused by failure. |
Remarks
➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅
SendMessage(Envelope)
TBD
Declaration
public virtual void SendMessage(Envelope message)
Parameters
Type | Name | Description |
---|---|---|
Envelope | message | TBD |
SendMessage(IActorRef, Object)
TBD
Declaration
public virtual void SendMessage(IActorRef sender, object message)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | sender | TBD |
Object | message | TBD |
SendSystemMessage(ISystemMessage)
Handles a ISystemMessage
Declaration
public virtual void SendSystemMessage(ISystemMessage systemMessage)
Parameters
Type | Name | Description |
---|---|---|
ISystemMessage | systemMessage | The system message to process. |
Remarks
➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅
SetActorFields(ActorBase)
TBD
Declaration
protected void SetActorFields(ActorBase actor)
Parameters
Type | Name | Description |
---|---|---|
ActorBase | actor | TBD |
SetChildrenTerminationReason(SuspendReason)
TBD
Declaration
protected bool SetChildrenTerminationReason(SuspendReason reason)
Parameters
Type | Name | Description |
---|---|---|
SuspendReason | reason | TBD |
Returns
Type | Description |
---|---|
Boolean | TBD |
SetReceiveTimeout(Nullable<TimeSpan>)
TBD
Declaration
public void SetReceiveTimeout(TimeSpan? timeout = null)
Parameters
Type | Name | Description |
---|---|---|
Nullable<TimeSpan> | timeout | TBD |
SetTerminated()
TBD
Declaration
protected void SetTerminated()
Start()
Starts this instance.
Declaration
public virtual void Start()
Stash(SystemMessage)
TBD
Declaration
protected void Stash(SystemMessage msg)
Parameters
Type | Name | Description |
---|---|---|
SystemMessage | msg | TBD |
Stop()
Async stop this actor
Declaration
public void Stop()
Remarks
➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅
Stop(IActorRef)
Stops the specified child.
Declaration
public void Stop(IActorRef child)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | child | The child. |
StopFunctionRefs()
Declaration
protected void StopFunctionRefs()
Suspend()
Suspends this instance.
Declaration
public void Suspend()
Remarks
➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅
TellWatchersWeDied()
TBD
Declaration
protected void TellWatchersWeDied()
TerminatedQueuedFor(IActorRef, Option<Object>)
TBD
Declaration
public void TerminatedQueuedFor(IActorRef subject, Option<object> customMessage)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | subject | Tracked subject |
Option<Object> | customMessage | Terminated custom message |
TryGetChildStatsByName(String, out IChildStats)
Tries to get the stats for the child with the specified name. The stats can be either ChildNameReserved indicating that only a name has been reserved for the child, or a ChildRestartStats for a child that has been initialized/created.
Declaration
public bool TryGetChildStatsByName(string name, out IChildStats child)
Parameters
Type | Name | Description |
---|---|---|
String | name | TBD |
IChildStats | child | TBD |
Returns
Type | Description |
---|---|
Boolean | TBD |
TryGetChildStatsByRef(IActorRef, out ChildRestartStats)
Tries to get the stats for the specified child.
Declaration
protected bool TryGetChildStatsByRef(IActorRef actor, out ChildRestartStats child)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | actor | TBD |
ChildRestartStats | child | TBD |
Returns
Type | Description |
---|---|
Boolean | TBD |
UnbecomeStacked()
TBD
Declaration
public void UnbecomeStacked()
UnreserveChild(String)
TBD
Declaration
protected void UnreserveChild(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | TBD |
Unwatch(IActorRef)
TBD
Declaration
public IActorRef Unwatch(IActorRef subject)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | subject | TBD |
Returns
Type | Description |
---|---|
IActorRef | TBD |
UnwatchWatchedActors(ActorBase)
TBD
Declaration
protected void UnwatchWatchedActors(ActorBase actor)
Parameters
Type | Name | Description |
---|---|---|
ActorBase | actor | TBD |
UseThreadContext(Action)
TBD
Declaration
public void UseThreadContext(Action action)
Parameters
Type | Name | Description |
---|---|---|
Action | action | TBD |
Watch(IActorRef)
TBD
Declaration
public IActorRef Watch(IActorRef subject)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | subject | TBD |
Returns
Type | Description |
---|---|
IActorRef | TBD |
WatchedActorTerminated(IActorRef, Boolean, Boolean)
When this actor is watching the subject of Terminated message it will be propagated to user's receive.
Declaration
protected void WatchedActorTerminated(IActorRef actor, bool existenceConfirmed, bool addressTerminated)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | actor | TBD |
Boolean | existenceConfirmed | TBD |
Boolean | addressTerminated | TBD |
WatchWith(IActorRef, Object)
TBD
Declaration
public IActorRef WatchWith(IActorRef subject, object message)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | subject | TBD |
Object | message | TBD |
Returns
Type | Description |
---|---|
IActorRef | TBD |
Explicit Interface Implementations
| Improve this Doc View SourceIActorContext.Child(String)
Declaration
IActorRef IActorContext.Child(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name |
Returns
Type | Description |
---|---|
IActorRef |
IActorContext.GetChildren()
Declaration
IEnumerable<IActorRef> IActorContext.GetChildren()
Returns
Type | Description |
---|---|
IEnumerable<IActorRef> |
IActorContext.Parent
Declaration
IActorRef IActorContext.Parent { get; }
Returns
Type | Description |
---|---|
IActorRef |
IUntypedActorContext.Become(UntypedReceive)
Declaration
void IUntypedActorContext.Become(UntypedReceive receive)
Parameters
Type | Name | Description |
---|---|---|
UntypedReceive | receive |
IUntypedActorContext.BecomeStacked(UntypedReceive)
Declaration
void IUntypedActorContext.BecomeStacked(UntypedReceive receive)
Parameters
Type | Name | Description |
---|---|---|
UntypedReceive | receive |