Packages

final class ClusterSingletonProxy extends Actor with ActorLogging

The ClusterSingletonProxy works together with the pekko.cluster.singleton.ClusterSingletonManager to provide a distributed proxy to the singleton actor.

The proxy can be started on every node where the singleton needs to be reached and used as if it were the singleton itself. It will then act as a router to the currently running singleton instance. If the singleton is not currently available, e.g., during hand off or startup, the proxy will buffer the messages sent to the singleton and then deliver them when the singleton is finally available. The size of the buffer is configurable and it can be disabled by using a buffer size of 0. When the buffer is full old messages will be dropped when new messages are sent via the proxy.

The proxy works by keeping track of the oldest cluster member. When a new oldest member is identified, e.g. because the older one left the cluster, or at startup, the proxy will try to identify the singleton on the oldest member by periodically sending an pekko.actor.Identify message until the singleton responds with its pekko.actor.ActorIdentity.

Note that this is a best effort implementation: messages can always be lost due to the distributed nature of the actors involved.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ClusterSingletonProxy
  2. ActorLogging
  3. Actor
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ClusterSingletonProxy(singletonManagerPath: String, settings: ClusterSingletonProxySettings)

Type Members

  1. type Receive = PartialFunction[Any, Unit]
    Definition Classes
    Actor

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def add(m: Member): Unit

    Adds new member if it has the right role.

    Adds new member if it has the right role.

    m

    New cluster member.

  5. val ageOrdering: Ordering[Member]
  6. def aroundPostRestart(reason: Throwable): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  7. def aroundPostStop(): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  8. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  9. def aroundPreStart(): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  10. def aroundReceive(receive: actor.Actor.Receive, msg: Any): Unit
    Attributes
    protected[pekko]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def buffer(msg: Any): Unit
  13. var buffer: MessageBuffer
  14. def cancelTimer(): Unit
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  16. val cluster: Cluster
  17. implicit val context: ActorContext
    Definition Classes
    Actor
  18. def createIdentifyId(i: Int): String
  19. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  21. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. def handleInitial(state: CurrentClusterState): Unit
  23. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  24. var identifyCounter: Int
  25. var identifyId: String
  26. def identifySingleton(): Unit

    Discard old singleton ActorRef and send a periodic message to self to identify the singleton.

  27. var identifyTimer: Option[Cancellable]
  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. def log: LoggingAdapter
    Definition Classes
    ActorLogging
  30. def matchingRole(member: Member): Boolean
  31. var membersByAge: SortedSet[Member]
  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  35. def postRestart(reason: Throwable): Unit
    Definition Classes
    Actor
    Annotations
    @throws(classOf[java.lang.Exception])
  36. def postStop(): Unit
    Definition Classes
    ClusterSingletonProxy → Actor
  37. def preRestart(reason: Throwable, message: Option[Any]): Unit
    Definition Classes
    Actor
    Annotations
    @throws(classOf[java.lang.Exception])
  38. def preStart(): Unit
    Definition Classes
    ClusterSingletonProxy → Actor
  39. def receive: PartialFunction[Any, Unit]
    Definition Classes
    ClusterSingletonProxy → Actor
  40. def remove(m: Member): Unit

    Removes a member.

    Removes a member.

    m

    Cluster member to remove.

  41. implicit final val self: ActorRef
    Definition Classes
    Actor
  42. def sendBuffered(): Unit
  43. final def sender(): ActorRef
    Definition Classes
    Actor
  44. var singleton: Option[ActorRef]
  45. val singletonPath: Array[String]
  46. def supervisorStrategy: SupervisorStrategy
    Definition Classes
    Actor
  47. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  48. def toString(): String
    Definition Classes
    AnyRef → Any
  49. def trackChange(block: () => Unit): Unit
  50. def unhandled(message: Any): Unit
    Definition Classes
    Actor
  51. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  52. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  53. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @Deprecated
    Deprecated

Inherited from ActorLogging

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Ungrouped