akka.persistence.multidc.scaladsl.ReplicatedEntity
Create new actor as child of this actor with the given name, which must not be null, empty or start with “$”.
Create new actor as child of this actor with the given name, which must
not be null, empty or start with “$”. If the given name is already in use,
an InvalidActorNameException
is thrown.
See akka.actor.Props for details on how to obtain a Props
object.
Create new actor as child of this actor and give it an automatically generated name (currently similar to base64-encoded integer count, reversed and with “$” prepended, may change in the future).
Create new actor as child of this actor and give it an automatically generated name (currently similar to base64-encoded integer count, reversed and with “$” prepended, may change in the future).
See akka.actor.Props for details on how to obtain a Props
object.
Construct an akka.actor.ActorSelection from the given path, which is parsed for wildcards (these are replaced by regular expressions internally).
Construct an akka.actor.ActorSelection from the given path, which is parsed for wildcards (these are replaced by regular expressions internally). No attempt is made to verify the existence of any part of the supplied path, it is recommended to send a message and gather the replies in order to resolve the matching set of actors.
Construct an akka.actor.ActorSelection from the given path, which is parsed for wildcards (these are replaced by regular expressions internally).
Construct an akka.actor.ActorSelection from the given path, which is parsed for wildcards (these are replaced by regular expressions internally). No attempt is made to verify the existence of any part of the supplied path, it is recommended to send a message and gather the replies in order to resolve the matching set of actors.
Get the child with the given name if it exists.
Returns all supervised children; this method returns a view (i.e.
Returns all supervised children; this method returns a view (i.e. a lazy collection) onto the internal collection of children. Targeted lookups should be using ActorContext.child instead for performance reasons:
// DON'T DO THIS: val badLookup = context.children find (_.path.name == "kid") // should better be expressed as: val goodLookup = context.child("kid")
Returns the dispatcher (MessageDispatcher) that is used for this Actor.
Returns the dispatcher (MessageDispatcher) that is used for this Actor. Importing this member will place an implicit ExecutionContext in scope.
Returns the supervising parent akka.actor.ActorRef.
Returns the supervising parent akka.actor.ActorRef.
When used with Cluster Sharding, this will be this entity's parent ShardRegion
.
Gets the current receive timeout.
Gets the current receive timeout.
When specified, the receive method should be able to handle a akka.actor.ReceiveTimeout
message.
Commands can be sent with the ReplicatedEntity
itself with this ActorRef
, or it can be passed
in reply messages.
Commands can be sent with the ReplicatedEntity
itself with this ActorRef
, or it can be passed
in reply messages.
WARNING: It is not possible to use self
from the constructor of the ReplicatedEntity
.
Replies can be sent with this sender()
ActorRef
an ActorRef
that is passed in the command.
Replies can be sent with this sender()
ActorRef
an ActorRef
that is passed in the command.
WARNING: It is not safe to use the sender()
method directly in different thread (e.g. from a Future).
If you need to refer to the original sender in a Future, store the reference before the Future, like so
val replyTo = ctx.sender(); Future { replyTo ! "ok" }
which is safe.
It IS safe to refer to the sender in the andThen
effect callbacks however.
Defines the inactivity timeout after which the sending of a akka.actor.ReceiveTimeout
message is triggered.
Defines the inactivity timeout after which the sending of a akka.actor.ReceiveTimeout
message is triggered.
Message handlers for timeout messages can be registered with CommandHandler#onReceiveTimeout.
1 millisecond is the minimum supported timeout.
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 Duration.Undefined
to switch off this feature.
Messages marked with akka.actor.NotInfluenceReceiveTimeout will not reset the timer. This can be useful when
ReceiveTimeout
should be fired by external inactivity but not influenced by internal activity,
e.g. scheduled tick messages.
Stop the actor pointed to by the given akka.actor.ActorRef; this is an asynchronous operation, i.e.
Stop the actor pointed to by the given akka.actor.ActorRef; this is
an asynchronous operation, i.e. involves a message send.
If this method is applied to the self
reference from inside an Actor
then that Actor is guaranteed to not process any further messages after
this call; please note that the processing of the current message will
continue, this method does not immediately terminate this actor.
The system that the actor belongs to.
The system that the actor belongs to. Importing this member will place an implicit ActorSystem in scope.
Start and cancel timers via the enclosed TimerScheduler
.
Start and cancel timers via the enclosed TimerScheduler
.
Message handlers for timer messages can be registered with CommandHandler#onTimer.
Unregisters this actor as Monitor for the provided ActorRef.
Unregisters this actor as Monitor for the provided ActorRef.
the provided ActorRef
Registers this actor as a Monitor for the provided ActorRef.
Registers this actor as a Monitor for the provided ActorRef.
This actor will receive a Terminated(subject)
message when watched
actor is terminated. Register handler for the Terminated
message
with CommandHandler#onTerminated
the provided ActorRef
Actor context for ReplicatedEntity with somewhat limited capabilities and additional functionality specifically replicated entities.
Not for user extension.