I have implemented an actix actor including the Supervised
trait. I then tried to start the actor in a supervised way using
let _: Addr<Unsync, _> = Supervisor::start(|_| MyActor::default());
Unfortunately when that actor stops it is not automatically restarted for some reason.
Dependency Versions
actix = "0.5"
Nikolay Kim, the author of actix, helped me analyze the issue. It turns out that assigning the
Supervisor::start()
result to a variable called_
will automatically throw away the result and so the supervisor will not actually start correctly.The solution to this issue is renaming the
_
variable to_addr
:After the rename the
Supervisor
correctly restarts theMyActor
actor after it has stopped.