Class DistributedData$
- java.lang.Object
-
- org.apache.pekko.actor.typed.ExtensionId<DistributedData>
-
- org.apache.pekko.cluster.ddata.typed.scaladsl.DistributedData$
-
public class DistributedData$ extends ExtensionId<DistributedData>
-
-
Field Summary
Fields Modifier and Type Field Description static DistributedData$MODULE$Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description DistributedData$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DistributedDatacreateExtension(ActorSystem<?> system)Create the extension, will be invoked at most one time per actor system where the extension is registered.DistributedDataget(ActorSystem<?> system)<A,B extends ReplicatedData>
Behavior<A>withReplicatorMessageAdapter(scala.Function1<ReplicatorMessageAdapter<A,B>,Behavior<A>> factory)When interacting with theDistributedData.replicatorfrom an actor theReplicatorMessageAdapterprovides convenient methods that adapts the response messages to the requesting actor's message protocol.-
Methods inherited from class org.apache.pekko.actor.typed.ExtensionId
apply, equals, hashCode, id
-
-
-
-
Field Detail
-
MODULE$
public static final DistributedData$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
get
public DistributedData get(ActorSystem<?> system)
-
createExtension
public DistributedData createExtension(ActorSystem<?> system)
Description copied from class:ExtensionIdCreate the extension, will be invoked at most one time per actor system where the extension is registered.- Specified by:
createExtensionin classExtensionId<DistributedData>
-
withReplicatorMessageAdapter
public <A,B extends ReplicatedData> Behavior<A> withReplicatorMessageAdapter(scala.Function1<ReplicatorMessageAdapter<A,B>,Behavior<A>> factory)
When interacting with theDistributedData.replicatorfrom an actor theReplicatorMessageAdapterprovides convenient methods that adapts the response messages to the requesting actor's message protocol.One
ReplicatorMessageAdapterinstance can be used for a givenReplicatedDatatype, e.g. anOrSet[String]. Interaction with severalpekko.cluster.ddata.Keys can be used via the same adapter but they must all be of the sameReplicatedDatatype. For interaction with several differentReplicatedDatatypes, e.g. anOrSet[String]and aGCounter, an adapter can be created for each type.*Warning*: A
ReplicatorMessageAdapterinstance is not thread-safe and must only be used from a single actor It must not be accessed from threads other than the ordinary actor message processing thread, such asFuturecallbacks. It must not be shared between several actor instances.- Parameters:
factory- Factory of theBehaviorfor the actor that is using theReplicatorMessageAdapter
-
-