Open tbenst opened 3 years ago
Ok, I think I came up with a relatively simple solution by modifying dictsrv
:
function dictsrv(d::Dict; remote=false)
sv = supervisor()
dsrv = DictSrv(spawn(ds, d; remote))
exec(dsrv.lk, Actors.supervise, sv);
dsrv
end
I suppose this is a bit inefficient, as I spawn one supervisor per actor, when it might be better to have one master supervisor? Would sv
as a global variable be preferred?
Suppose I'm using the distributed dict example from tutorial, and I do something that throws an error. now, my Actor is permanently broken. It would be great to have more resiliency. I'm reading the docs on Supervisors, but it's not completely clear to me how to implement this, although it seems possible.
In particular, I'm not sure how to supervise Actors that are spawned inside of a function--unless I do something messy like append each spawn to a global Array..? Feels like an anti-pattern but maybe that's the best way?
What happens:
What I want: