Class/Object

akka.cluster.singleton

ClusterSingletonProxy

Related Docs: object ClusterSingletonProxy | package singleton

Permalink

final class ClusterSingletonProxy extends Actor with ActorLogging

The ClusterSingletonProxy works together with the akka.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 akka.actor.Identify message until the singleton responds with its akka.actor.ActorIdentity.

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

Source
ClusterSingletonProxy.scala
Linear Supertypes
ActorLogging, Actor, AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ClusterSingletonProxy
  2. ActorLogging
  3. Actor
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

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

    Permalink

Type Members

  1. type Receive = PartialFunction[Any, Unit]

    Permalink
    Definition Classes
    Actor

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from ClusterSingletonProxy to any2stringadd[ClusterSingletonProxy] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ClusterSingletonProxy, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from ClusterSingletonProxy to ArrowAssoc[ClusterSingletonProxy] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def add(m: Member): Unit

    Permalink

    Adds new member if it has the right role.

    Adds new member if it has the right role.

    m

    New cluster member.

  7. val ageOrdering: Ordering[Member]

    Permalink
  8. def aroundPostRestart(reason: Throwable): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  9. def aroundPostStop(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  10. def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  11. def aroundPreStart(): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  12. def aroundReceive(receive: actor.Actor.Receive, msg: Any): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
    Annotations
    @InternalApi()
  13. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  14. def buffer(msg: Any): Unit

    Permalink
  15. var buffer: MessageBuffer

    Permalink
  16. def cancelTimer(): Unit

    Permalink
  17. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. val cluster: Cluster

    Permalink
  19. implicit val context: ActorContext

    Permalink
    Definition Classes
    Actor
  20. def createIdentifyId(i: Int): String

    Permalink
  21. def ensuring(cond: (ClusterSingletonProxy) ⇒ Boolean, msg: ⇒ Any): ClusterSingletonProxy

    Permalink
    Implicit information
    This member is added by an implicit conversion from ClusterSingletonProxy to Ensuring[ClusterSingletonProxy] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  22. def ensuring(cond: (ClusterSingletonProxy) ⇒ Boolean): ClusterSingletonProxy

    Permalink
    Implicit information
    This member is added by an implicit conversion from ClusterSingletonProxy to Ensuring[ClusterSingletonProxy] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  23. def ensuring(cond: Boolean, msg: ⇒ Any): ClusterSingletonProxy

    Permalink
    Implicit information
    This member is added by an implicit conversion from ClusterSingletonProxy to Ensuring[ClusterSingletonProxy] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  24. def ensuring(cond: Boolean): ClusterSingletonProxy

    Permalink
    Implicit information
    This member is added by an implicit conversion from ClusterSingletonProxy to Ensuring[ClusterSingletonProxy] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  25. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  27. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  28. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from ClusterSingletonProxy to StringFormat[ClusterSingletonProxy] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  29. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  30. def handleInitial(state: CurrentClusterState): Unit

    Permalink
  31. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  32. var identifyCounter: Int

    Permalink
  33. var identifyId: String

    Permalink
  34. def identifySingleton(): Unit

    Permalink

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

  35. var identifyTimer: Option[Cancellable]

    Permalink
  36. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  37. def log: LoggingAdapter

    Permalink
    Definition Classes
    ActorLogging
  38. def matchingRole(member: Member): Boolean

    Permalink
  39. var membersByAge: SortedSet[Member]

    Permalink
  40. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  41. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  43. def postRestart(reason: Throwable): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  44. def postStop(): Unit

    Permalink
    Definition Classes
    ClusterSingletonProxy → Actor
  45. def preRestart(reason: Throwable, message: Option[Any]): Unit

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  46. def preStart(): Unit

    Permalink
    Definition Classes
    ClusterSingletonProxy → Actor
  47. def receive: PartialFunction[Any, Unit]

    Permalink
    Definition Classes
    ClusterSingletonProxy → Actor
  48. def remove(m: Member): Unit

    Permalink

    Removes a member.

    Removes a member.

    m

    Cluster member to remove.

  49. implicit final val self: ActorRef

    Permalink
    Definition Classes
    Actor
  50. def sendBuffered(): Unit

    Permalink
  51. final def sender(): ActorRef

    Permalink
    Definition Classes
    Actor
  52. var singleton: Option[ActorRef]

    Permalink
  53. val singletonPath: Array[String]

    Permalink
  54. def supervisorStrategy: SupervisorStrategy

    Permalink
    Definition Classes
    Actor
  55. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  56. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  57. def trackChange(block: () ⇒ Unit): Unit

    Permalink
  58. def unhandled(message: Any): Unit

    Permalink
    Definition Classes
    Actor
  59. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. def [B](y: B): (ClusterSingletonProxy, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from ClusterSingletonProxy to ArrowAssoc[ClusterSingletonProxy] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from ActorLogging

Inherited from Actor

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from ClusterSingletonProxy to any2stringadd[ClusterSingletonProxy]

Inherited by implicit conversion StringFormat from ClusterSingletonProxy to StringFormat[ClusterSingletonProxy]

Inherited by implicit conversion Ensuring from ClusterSingletonProxy to Ensuring[ClusterSingletonProxy]

Inherited by implicit conversion ArrowAssoc from ClusterSingletonProxy to ArrowAssoc[ClusterSingletonProxy]

Ungrouped