Merge pull request #29738 from YikSanChan/add-doc-to-explain-cleanup-impl

Explain why Mailbox#cleanup uses recursion [ci skip]
This commit is contained in:
Patrik Nordwall 2021-01-13 07:45:26 +01:00 committed by GitHub
commit 89583aa8cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -385,6 +385,9 @@ trait MessageQueue {
* is expected to transfer all remaining messages into the dead letter queue
* which is passed in. The owner of this MessageQueue is passed in if
* available (e.g. for creating DeadLetters()), /deadletters otherwise.
*
* Note that we implement the method in a recursive manner mainly for
* atomicity (not touching the queue twice).
*/
def cleanUp(owner: ActorRef, deadLetters: MessageQueue): Unit
}