final case class Subscribe[A <: ReplicatedData](key: Key[A], subscriber: ActorRef) extends ReplicatorMessage with Product with Serializable

Register a subscriber that will be notified with a Changed message when the value of the given key is changed. Current value is also sent as a Changed message to a new subscriber.

In addition to subscribing to individual keys it is possible to subscribe to all keys with a given prefix by using a * at the end of the key id. For example GCounterKey("counter-*"). Notifications will be sent for all matching keys, also new keys added later.

Subscribers will be notified periodically with the configured notify-subscribers-interval, and it is also possible to send an explicit FlushChanges message to the Replicator to notify the subscribers immediately.

The subscriber will automatically be unregistered if it is terminated.

If the key is deleted the subscriber is notified with a Deleted message.

If the key is expired the subscriber is notified with an Expired message.

Source
Replicator.scala
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Subscribe
  2. Product
  3. Equals
  4. ReplicatorMessage
  5. Serializable
  6. AnyRef
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Subscribe(key: Key[A], subscriber: ActorRef)

Value Members

  1. val key: Key[A]
  2. def productElementNames: Iterator[String]
    Definition Classes
    Product
  3. val subscriber: ActorRef