Class ShardRegion.Passivate

  extended by akka.contrib.pattern.ShardRegion.Passivate
All Implemented Interfaces:
ShardRegion.ShardRegionCommand, java.io.Serializable, scala.Equals, scala.Product
Enclosing class:

public static class ShardRegion.Passivate
extends java.lang.Object
implements ShardRegion.ShardRegionCommand, scala.Product, scala.Serializable

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

PoisonPill is a perfectly fine stopMessage.

See Also:
Serialized Form

Constructor Summary
ShardRegion.Passivate(java.lang.Object stopMessage)
Method Summary
 java.lang.Object stopMessage()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface scala.Product
productArity, productElement, productIterator, productPrefix
Methods inherited from interface scala.Equals
canEqual, equals

Constructor Detail


public ShardRegion.Passivate(java.lang.Object stopMessage)
Method Detail


public java.lang.Object stopMessage()