Barkety
Barkety copied to clipboard
Factory w/supervision pattern looks broken
If the Chatter or RoomChatter actors blow up, say from an exception being thrown from the inner Chat or MultiUserChat objects, then the ChatSupervisor will restart those actors. However, this will create new actors that the external client doesn't know about, because the supervisor only returns the original actor when the "factory" method is invoked (CreateChat, etc.)
One way to solve this is that the newly (re-)created Chatter/RoomChatter object should reply with its ref to the sender of the create message, rather than the supervisor doing this. That way the receiver can do something with the recreated actor, like registering the parent, etc.