Trait

org.squbs.lifecycle

GracefulStopHelper

Related Doc: package lifecycle

Permalink

trait GracefulStopHelper extends GracefulStopSupport with ActorLogging

The trait provides some helper methods to support graceful stop of an actor in Squbs framework

Once you mix this trait in your actor, you can override stopTimeout to indicate how much time this actor may need to stop it self.

When the actor gets created, it will send the stopTimeout to its parent. You can have the logic in the parent actor to decide to spend how much time to stop its children

If you want your actor to stop gracefully, you should put your stop logic in the receive method responding to the GracefulStop message

Self Type
GracefulStopHelper with Actor
Linear Supertypes
ActorLogging, GracefulStopSupport, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GracefulStopHelper
  2. ActorLogging
  3. GracefulStopSupport
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def defaultLeafActorStop: Unit

    Permalink

    Default gracefully stop behavior for leaf level actors (Actors only receive the msg as input and send out a result) towards the GracefulStop message

    Default gracefully stop behavior for leaf level actors (Actors only receive the msg as input and send out a result) towards the GracefulStop message

    Simply stop itself

    Attributes
    protected
  7. final def defaultMidActorStop(dependencies: Iterable[ActorRef], timeout: FiniteDuration = stopTimeout / 2): Unit

    Permalink

    Default gracefully stop behavior for middle level actors (Actors rely on the results of other actors to finish their tasks) towards the GracefulStop message

    Default gracefully stop behavior for middle level actors (Actors rely on the results of other actors to finish their tasks) towards the GracefulStop message

    Simply propagate the GracefulStop message to all actors that should be stop ahead of this actor

    If some actors failed to respond to the GracefulStop message, It will send PoisonPill again

    After all the actors get terminated it stops itself

    Attributes
    protected
  8. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def gracefulStop(target: ActorRef, timeout: FiniteDuration, stopMessage: Any): Future[Boolean]

    Permalink
    Definition Classes
    GracefulStopSupport
  13. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  15. def log: LoggingAdapter

    Permalink
    Definition Classes
    ActorLogging
  16. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  19. def stopTimeout: FiniteDuration

    Permalink

    Duration that the actor needs to finish the graceful stop.

    Duration that the actor needs to finish the graceful stop. Override it for customized timeout and it will be registered to the reaper Default to 5 seconds

    returns

    Duration

  20. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ActorLogging

Inherited from GracefulStopSupport

Inherited from AnyRef

Inherited from Any

Ungrouped