Class/Object

net.psforever.objects.guid.actor

UniqueNumberSystem

Related Docs: object UniqueNumberSystem | package actor

Permalink

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
Linear Supertypes
Actor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. UniqueNumberSystem
  2. Actor
  3. AnyRef
  4. 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 UniqueNumberSystem(guid: NumberPoolHub, poolActors: Map[String, ActorRef])

    Permalink

    guid

    the NumberPoolHub that is partially manipulated by this Actor

    poolActors

    a common mapping created from the NumberPools in guid; there is currently no check for this condition save for requests failing

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 UniqueNumberSystem to any2stringadd[UniqueNumberSystem] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (UniqueNumberSystem, B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from UniqueNumberSystem to ArrowAssoc[UniqueNumberSystem] 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 aroundPostRestart(reason: Throwable): Unit

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  7. def aroundPostStop(): Unit

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

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  9. def aroundPreStart(): Unit

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

    Permalink
    Attributes
    protected[akka]
    Definition Classes
    Actor
  11. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  12. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. implicit val context: ActorContext

    Permalink
    Definition Classes
    Actor
  14. def ensuring(cond: (UniqueNumberSystem) ⇒ Boolean, msg: ⇒ Any): UniqueNumberSystem

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

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  23. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. final def ne(arg0: AnyRef): Boolean

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

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

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

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

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  30. def preRestart(reason: Throwable, message: Option[Any]): Unit

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

    Permalink
    Definition Classes
    Actor
    Annotations
    @throws( classOf[java.lang.Exception] )
  32. def receive: Receive

    Permalink
    Definition Classes
    UniqueNumberSystem → Actor
  33. implicit final val self: ActorRef

    Permalink
    Definition Classes
    Actor
  34. final def sender(): ActorRef

    Permalink
    Definition Classes
    Actor
  35. def supervisorStrategy: SupervisorStrategy

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  38. def unhandled(message: Any): Unit

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

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

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

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

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

Inherited from Actor

Inherited from AnyRef

Inherited from Any

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

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

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

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

Ungrouped