final case class Passivate(stopMessage: Any) extends ShardRegionCommand with Product with Serializable

If the state of the entities are persistent you may stop entities that are not used to reduce memory consumption. This is done by the application specific implementation of the entity actors for example by defining receive timeout (context.setReceiveTimeout). If a message is already enqueued to the entity when it stops itself the enqueued message in the mailbox will be dropped. To support graceful passivation without losing such messages the entity actor can send this Passivate message to its parent ShardRegion. The specified wrapped stopMessage will be sent back to the entity, which is then supposed to stop itself. Incoming messages will be buffered by the ShardRegion between reception of Passivate and termination of the entity. Such buffered messages are thereafter delivered to a new incarnation of the entity.

akka.actor.PoisonPill is a perfectly fine stopMessage.

Annotations
@SerialVersionUID()
Source
ShardRegion.scala
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Passivate
  2. Serializable
  3. Product
  4. Equals
  5. ShardRegionCommand
  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 Passivate(stopMessage: Any)

Value Members

  1. def productElementNames: Iterator[String]
    Definition Classes
    Product
  2. val stopMessage: Any