slawlor/ractor

how to restart a actor?

Sherlock-Holo opened this issue · 1 comments

when an error occurs while an actor handling a message, the actor should tell the supervisor, and if this is an unhandled error, the supervisor should restart a new actor

however I don't see how to let the supervisor restart an actor, the https://docs.rs/ractor/0.7.6/ractor/actor/trait.Actor.html#associatedtype.Arguments is not Clone, so we can't clone the argument and pass the argument to some restart function, let it create a new actor

Yeah the idea is to re-create the actor. You'll need to re-instantiate the actor which will go through a pre_start routine again before handling messages.