Cleanup actor mailbox messages on destroy
This commit is contained in:
parent
3a7a5ed669
commit
78d3a97dd0
@ -237,8 +237,14 @@ public final class TbActorMailbox implements TbActorCtx {
|
||||
try {
|
||||
ready.set(NOT_READY);
|
||||
actor.destroy(stopReason, cause);
|
||||
highPriorityMsgs.forEach(msg -> msg.onTbActorStopped(stopReason));
|
||||
normalPriorityMsgs.forEach(msg -> msg.onTbActorStopped(stopReason));
|
||||
highPriorityMsgs.removeIf(msg -> {
|
||||
msg.onTbActorStopped(stopReason);
|
||||
return true;
|
||||
});
|
||||
normalPriorityMsgs.removeIf(msg -> {
|
||||
msg.onTbActorStopped(stopReason);
|
||||
return true;
|
||||
});
|
||||
} catch (Throwable t) {
|
||||
log.warn("[{}] Failed to destroy actor: ", selfId, t);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user