public override void CleanUp()
{
if (HasMessages)
{
Envelope envelope;
// Drain all remaining messages to the StandardOutLogger.
// CleanUp is called after switching out the mailbox, which is why
// this kind of look works without a limit.
while (TryDequeue(out envelope))
{
// Logging.StandardOutLogger is a MinimalActorRef, i.e. not a "real" actor
Logging.StandardOutLogger.Tell(envelope.Message, envelope.Sender);
}
}
base.CleanUp();
}
}