Java API: Add a JVM shutdown hook that will be run when the JVM process begins its shutdown sequence.
Java API: Add a JVM shutdown hook that will be run when the JVM process begins its shutdown sequence. Added hooks may run in an order concurrently, but they are running before Akka internal shutdown hooks, e.g. those shutting down Artery.
The returned
makes it possible to de-register the hook. For example
on actor system shutdown to avoid leaking references to the actor system in tests.Cancellable
For shutdown hooks that does not have any requirements on running before the Akka shutdown hooks the standard library JVM shutdown hooks APIs are better suited.
Scala API: Add a JVM shutdown hook that will be run when the JVM process begins its shutdown sequence.
Scala API: Add a JVM shutdown hook that will be run when the JVM process begins its shutdown sequence. Added hooks may run in any order concurrently, but they are running before Akka internal shutdown hooks, e.g. those shutting down Artery.
The returned
makes it possible to de-register the hook. For example
on actor system shutdown to avoid leaking references to the actor system in tests.Cancellable
For shutdown hooks that does not have any requirements on running before the Akka shutdown hooks the standard library JVM shutdown hooks APIs are better suited.
Java API: Add a JVM shutdown hook that will be run when the JVM process begins its shutdown sequence.
Java API: Add a JVM shutdown hook that will be run when the JVM process begins its shutdown sequence. Added hooks may run in any order concurrently, but they are running before Akka internal shutdown hooks, e.g. those shutting down Artery.
Scala API: Add a JVM shutdown hook that will be run when the JVM process begins its shutdown sequence.
Scala API: Add a JVM shutdown hook that will be run when the JVM process begins its shutdown sequence. Added hooks may run in any order concurrently, but they are running before Akka internal shutdown hooks, e.g. those shutting down Artery.
Java API: Add a task to a phase.
Java API: Add a task to a phase. It doesn't remove previously added tasks. Tasks added to the same phase are executed in parallel without any ordering assumptions. Next phase will not start until all tasks of previous phase have been completed.
Tasks should typically be registered as early as possible after system startup. When running the coordinated shutdown tasks that have been registered will be performed but tasks that are added too late will not be run. It is possible to add a task to a later phase by a task in an earlier phase and it will be performed.
Scala API: Add a task to a phase.
Scala API: Add a task to a phase. It doesn't remove previously added tasks. Tasks added to the same phase are executed in parallel without any ordering assumptions. Next phase will not start until all tasks of previous phase have been completed.
Tasks should typically be registered as early as possible after system startup. When running the coordinated shutdown tasks that have been registered will be performed but tasks that are added too late will not be run. It is possible to add a task to a later phase by a task in an earlier phase and it will be performed.
The Reason
for the shutdown as passed to the run
method.
The Reason
for the shutdown as passed to the run
method. Optional.empty
if the shutdown
has not been started.
Java API: Run tasks of all phases including and after the given phase.
Java API: Run tasks of all phases including and after the given phase.
The returned CompletionStage
is completed when all such tasks have been completed,
or there is a failure when recovery is disabled.
It's safe to call this method multiple times. It will only run the shutdown sequence once.
Scala API: Run tasks of all phases including and after the given phase.
Scala API: Run tasks of all phases including and after the given phase.
The returned Future
is completed when all such tasks have been completed,
or there is a failure when recovery is disabled.
It's safe to call this method multiple times. It will only run shutdown sequence once.
Scala API: Run tasks of all phases.
Scala API: Run tasks of all phases. The returned
Future
is completed when all tasks have been completed,
or there is a failure when recovery is disabled.
It's safe to call this method multiple times. It will only run the shutdown sequence once.
Java API: Run tasks of all phases.
Java API: Run tasks of all phases. The returned
CompletionStage
is completed when all tasks have been completed,
or there is a failure when recovery is disabled.
It's safe to call this method multiple times. It will only run the shutdown sequence once.
The Reason
for the shutdown as passed to the run
method.
The Reason
for the shutdown as passed to the run
method. None
if the shutdown
has not been started.
The configured timeout for a given phase
.
The configured timeout for a given phase
.
For example useful as timeout when actor ask
requests
is used as a task.
Sum of timeouts of all phases that have some task.
(Since version 2.5.8) Use the method with reason
parameter instead
(Since version 2.5.8) Use the method with reason
parameter instead
(Since version 2.5.8) Use the method with reason
parameter instead
(Since version 2.5.8) Use the method with reason
parameter instead