Class TestActorRefBase<TActor>
This is the base class for TestActorRefs
public abstract class TestActorRefBase<TActor> : ICanTell, IEquatable<IActorRef>, IInternalActorRef, IActorRef, IComparable<IActorRef>, ISurrogated, IComparable, IActorRefScope where TActor : ActorBase
Type Parameters
TActor
The type of actor
- Inheritance
-
TestActorRefBase<TActor>
- Implements
-
ICanTellIEquatable<IActorRef>IInternalActorRefIActorRefIComparable<IActorRef>ISurrogatedIActorRefScope
- Derived
- Inherited Members
Constructors
TestActorRefBase(ActorSystem, Props, IActorRef, string)
TBD
protected TestActorRefBase(ActorSystem system, Props actorProps, IActorRef supervisor = null, string name = null)
Parameters
system
ActorSystemTBD
actorProps
PropsTBD
supervisor
IActorRefTBD
name
stringTBD
Properties
InternalRef
TBD
protected InternalTestActorRef InternalRef { get; }
Property Value
Path
Gets the path of this instance
public ActorPath Path { get; }
Property Value
- ActorPath
Ref
TBD
public IActorRef Ref { get; }
Property Value
- IActorRef
UnderlyingActor
TBD
public TActor UnderlyingActor { get; }
Property Value
- TActor
Methods
CompareTo(object)
public int CompareTo(object obj)
Parameters
obj
object
Returns
Equals(IActorRef)
public bool Equals(IActorRef other)
Parameters
other
IActorRef
Returns
Equals(object)
public override bool Equals(object obj)
Parameters
obj
object
Returns
Forward(object)
Forwards a message to this actor. If this call is made from within an actor, the current actor will be the sender. If the call is made from a test class that is based on TestKit, TestActor will will be the sender;
public void Forward(object message)
Parameters
message
objectThe message.
GetHashCode()
public override int GetHashCode()
Returns
Receive(object, IActorRef)
Directly inject messages into actor receive behavior. Any exceptions thrown will be available to you, while still being able to use become/unbecome. Note: This method violates the actor model and could cause unpredictable behavior. For example, a Receive call to an actor could run simultaneously (2 simultaneous threads running inside the actor) with the actor's handling of a previous Tell call.
public void Receive(object message, IActorRef sender = null)
Parameters
message
objectThe message.
sender
IActorRefThe sender.
ReceiveAsync(object, IActorRef)
Directly inject messages into actor ReceiveAsync behavior. Any exceptions thrown will be available to you, while still being able to use become/unbecome. Note: This method violates the actor model and could cause unpredictable behavior. For example, a Receive call to an actor could run simultaneously (2 simultaneous threads running inside the actor) with the actor's handling of a previous Tell call.
public Task ReceiveAsync(object message, IActorRef sender = null)
Parameters
message
objectThe message.
sender
IActorRefThe sender.
Returns
SendSystemMessage(ISystemMessage)
TBD
public void SendSystemMessage(ISystemMessage message)
Parameters
message
ISystemMessageTBD
SendSystemMessage(ISystemMessage, IActorRef)
TBD
public void SendSystemMessage(ISystemMessage message, IActorRef sender)
Parameters
message
ISystemMessageTBD
sender
IActorRefTBD
Tell(object)
Sends a message to this actor. If this call is made from within an actor, the current actor will be the sender. If the call is made from a test class that is based on TestKit, TestActor will will be the sender; otherwise Akka.Actor.ActorRefs.NoSender will be set as sender.
public void Tell(object message)
Parameters
message
objectThe message.
Tell(object, IActorRef)
Sends a message to this actor with the specified sender.
public void Tell(object message, IActorRef sender)
Parameters
message
objectThe message.
sender
IActorRefThe sender
ToActorRef(TestActorRefBase<TActor>)
TBD
public static IActorRef ToActorRef(TestActorRefBase<TActor> actorRef)
Parameters
actorRef
TestActorRefBase<TActor>TBD
Returns
- IActorRef
TBD
ToString()
public override string ToString()
Returns
Unwatch(IActorRef)
Deregisters this actor from being a death monitor of the provided ActorRef This means that this actor will not get a Terminated()-message when the provided actor is permanently terminated. Returns the same ActorRef that is provided to it, to allow for cleaner invocations.
public void Unwatch(IActorRef subject)
Parameters
subject
IActorRefThe subject to unwatch.
Watch(IActorRef)
Registers this actor to be a death monitor of the provided ActorRef This means that this actor will get a Terminated()-message when the provided actor is permanently terminated. Returns the same ActorRef that is provided to it, to allow for cleaner invocations.
public void Watch(IActorRef subject)
Parameters
subject
IActorRefThe subject to watch.
Operators
operator ==(IActorRef, TestActorRefBase<TActor>)
Compares a specified Akka.Actor.IActorRef to an TestActorRefBase<TActor> for equality.
public static bool operator ==(IActorRef actorRef, TestActorRefBase<TActor> testActorRef)
Parameters
actorRef
IActorRefThe actor used for comparison
testActorRef
TestActorRefBase<TActor>The test actor used for comparison
Returns
- bool
true
if both actors are equal; otherwisefalse
operator ==(TestActorRefBase<TActor>, IActorRef)
Compares a specified TestActorRefBase<TActor> to an Akka.Actor.IActorRef for equality.
public static bool operator ==(TestActorRefBase<TActor> testActorRef, IActorRef actorRef)
Parameters
testActorRef
TestActorRefBase<TActor>The test actor used for comparison
actorRef
IActorRefThe actor used for comparison
Returns
- bool
true
if both actors are equal; otherwisefalse
operator !=(IActorRef, TestActorRefBase<TActor>)
Compares a specified Akka.Actor.IActorRef to an TestActorRefBase<TActor> for inequality.
public static bool operator !=(IActorRef actorRef, TestActorRefBase<TActor> testActorRef)
Parameters
actorRef
IActorRefThe actor used for comparison
testActorRef
TestActorRefBase<TActor>The test actor used for comparison
Returns
- bool
true
if both actors are not equal; otherwisefalse
operator !=(TestActorRefBase<TActor>, IActorRef)
Compares a specified TestActorRefBase<TActor> to an Akka.Actor.IActorRef for inequality.
public static bool operator !=(TestActorRefBase<TActor> testActorRef, IActorRef actorRef)
Parameters
testActorRef
TestActorRefBase<TActor>The test actor used for comparison
actorRef
IActorRefThe actor used for comparison
Returns
- bool
true
if both actors are not equal; otherwisefalse