Any reason to abandon the stop method?

When I disabled ActorSystem, I found that it was ActorSystem::shutdowndeprecated. He suggested "Use the terminate() method instead".

But the decomposition of these methods is almost the same:

  /**
   * Terminates this actor system. This will stop the guardian actor, which in turn
   * will recursively stop all its child actors, then the system guardian
   * (below which the logging actors reside) and the execute all registered
   * termination handlers (see [[ActorSystem#registerOnTermination]]).
   * Be careful to not schedule any operations on completion of the returned future
   * using the `dispatcher` of this actor system as it will have been shut down before the
   * future completes.
   */
  def terminate(): Future[Terminated]

and

  /**
   * Stop this actor system. This will stop the guardian actor, which in turn
   * will recursively stop all its child actors, then the system guardian
   * (below which the logging actors reside) and the execute all registered
   * termination handlers (see [[ActorSystem#registerOnTermination]]).
   */
  @deprecated("Use the terminate() method instead", "2.4")
  def shutdown(): Unit

with one exception, the return type has changed. What is the reason for giving up shutdown? Isn't it safe?

+4
source share
1 answer

Obsolescence seems to have been to follow the β€œfinal” agreement used in other areas of the project, as well as expose completion events.

The important part is the completion events:

, - , , Akka

. :

+4

All Articles