class UniqueNumberSystem extends Actor
An Actor that wraps around converted NumberPools and synchronizes a portion of the number registration process.
The ultimate goal is to manage a coherent group of unique identifiers for a given "region" (Zone).
Both parts of the UID system sit atop the Zone for easy external access.
The plain part - the NumberPoolHub here - is used for low-priority requests such as checking for existing associations.
This Actor is the involved portion that paces registration and unregistration.
A four part process is used for object registration tasks.
First, the requested NumberPool is located among the list of known NumberPools.
Second, an asynchronous request is sent to that pool to retrieve a number.
(Only any number. Only a failing case allows for selection of a specific number.)
Third, the asynchronous request returns and the original information about the request is recovered.
Fourth, both sides of the contract are completed by the object being assigned the number and
the underlying "number source" is made to remember an association between the object and the number.
Short circuits and recoveries as available on all steps though reporting is split between logging and callbacks.
The process of removing the association between a number and object (unregistering) is a similar four part process.
The important relationship between this Actor and the Map of NumberPoolActors is an "gate."
A single Map is constructed and shared between multiple entry points to the UID system where requests are messaged.
Multiple entry points send messages to the same NumberPool.
That NumberPool deals with the messages one at a time and sends reply to each entry point that communicated with it.
This process is almost as fast as the process of the NumberPool selecting a number.
(At least, both should be fast.)
- Source
- UniqueNumberSystem.scala
- Alphabetic
- By Inheritance
- UniqueNumberSystem
- Actor
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new UniqueNumberSystem(guid: NumberPoolHub, poolActors: Map[String, ActorRef])
- guid
the
NumberPoolHubthat is partially manipulated by thisActor- poolActors
a common mapping created from the
NumberPools inguid; there is currently no check for this condition save for requests failing
Type Members
- type Receive = PartialFunction[Any, Unit]
- Definition Classes
- Actor
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def aroundPostRestart(reason: Throwable): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
- def aroundPostStop(): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
- def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
- def aroundPreStart(): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
- def aroundReceive(receive: akka.actor.Actor.Receive, msg: Any): Unit
- Attributes
- protected[akka]
- Definition Classes
- Actor
- Annotations
- @InternalApi()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- implicit val context: ActorContext
- Definition Classes
- Actor
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def postRestart(reason: Throwable): Unit
- Definition Classes
- Actor
- Annotations
- @throws(classOf[java.lang.Exception])
- def postStop(): Unit
- Definition Classes
- Actor
- Annotations
- @throws(classOf[java.lang.Exception])
- def preRestart(reason: Throwable, message: Option[Any]): Unit
- Definition Classes
- Actor
- Annotations
- @throws(classOf[java.lang.Exception])
- def preStart(): Unit
- Definition Classes
- Actor
- Annotations
- @throws(classOf[java.lang.Exception])
- def receive: Receive
- Definition Classes
- UniqueNumberSystem → Actor
- implicit final val self: ActorRef
- Definition Classes
- Actor
- final def sender(): ActorRef
- Definition Classes
- Actor
- def supervisorStrategy: SupervisorStrategy
- Definition Classes
- Actor
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def unhandled(message: Any): Unit
- Definition Classes
- Actor
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()