clarify ExecutionContext for whenTerminated operations (#28537)
This commit is contained in:
parent
3c24fa7dee
commit
45ed6eabca
2 changed files with 14 additions and 8 deletions
|
|
@ -116,9 +116,12 @@ abstract class ActorSystem[-T] extends ActorRef[T] with Extensions with ClassicA
|
|||
def terminate(): Unit
|
||||
|
||||
/**
|
||||
* Scala API: Returns a Future which will be completed after the ActorSystem has been terminated
|
||||
* and termination hooks have been executed. The `ActorSystem` can be stopped with [[ActorSystem.terminate]]
|
||||
* Scala API: Returns a Future which will be completed after the ActorSystem has been terminated.
|
||||
* The `ActorSystem` can be stopped with [[ActorSystem.terminate]]
|
||||
* or by stopping the guardian actor.
|
||||
*
|
||||
* Be careful to not schedule any operations, such as `onComplete`, on the dispatchers (`ExecutionContext`)
|
||||
* of this actor system as they will have been shut down before this future completes.
|
||||
*/
|
||||
def whenTerminated: Future[Done]
|
||||
|
||||
|
|
@ -126,6 +129,9 @@ abstract class ActorSystem[-T] extends ActorRef[T] with Extensions with ClassicA
|
|||
* Java API: Returns a CompletionStage which will be completed after the ActorSystem has been terminated
|
||||
* and termination hooks have been executed. The `ActorSystem` can be stopped with [[ActorSystem.terminate]]
|
||||
* or by stopping the guardian actor.
|
||||
*
|
||||
* Be careful to not schedule any operations, such as `thenRunAsync`, on the dispatchers (`Executor`) of this
|
||||
* actor system as they will have been shut down before this CompletionStage completes.
|
||||
*/
|
||||
def getWhenTerminated: CompletionStage[Done]
|
||||
|
||||
|
|
|
|||
|
|
@ -684,9 +684,9 @@ abstract class ActorSystem extends ActorRefFactory with ClassicActorSystemProvid
|
|||
* Returns a Future which will be completed after the ActorSystem has been terminated
|
||||
* and termination hooks have been executed. If you registered any callback with
|
||||
* [[ActorSystem#registerOnTermination]], the returned Future from this method will not complete
|
||||
* until all the registered callbacks are finished. Be careful to not schedule any operations
|
||||
* on the `dispatcher` of this actor system as it will have been shut down before this
|
||||
* future completes.
|
||||
* until all the registered callbacks are finished. Be careful to not schedule any operations,
|
||||
* such as `onComplete`, on the dispatchers (`ExecutionContext`) of this actor system as they
|
||||
* will have been shut down before this future completes.
|
||||
*/
|
||||
def whenTerminated: Future[Terminated]
|
||||
|
||||
|
|
@ -694,9 +694,9 @@ abstract class ActorSystem extends ActorRefFactory with ClassicActorSystemProvid
|
|||
* Returns a CompletionStage which will be completed after the ActorSystem has been terminated
|
||||
* and termination hooks have been executed. If you registered any callback with
|
||||
* [[ActorSystem#registerOnTermination]], the returned CompletionStage from this method will not complete
|
||||
* until all the registered callbacks are finished. Be careful to not schedule any operations
|
||||
* on the `dispatcher` of this actor system as it will have been shut down before this
|
||||
* future completes.
|
||||
* until all the registered callbacks are finished. Be careful to not schedule any operations,
|
||||
* such as `thenRunAsync`, on the dispatchers (`Executor`) of this actor system as they
|
||||
* will have been shut down before this CompletionStage completes.
|
||||
*/
|
||||
def getWhenTerminated: CompletionStage[Terminated]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue