Skip to content

Commit

Permalink
fix(core/supervisor): pre-spawn actors in Multicast to avoid deadlock (
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldsteinE authored Aug 11, 2023
1 parent 9c41531 commit 7e56faf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion elfo-core/src/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,12 @@ where
None => visitor.empty(envelope),
},
Outcome::Multicast(list) => {
let iter = list.into_iter().filter_map(|key| get_or_spawn!(self, key));
for key in list.iter() {
if !self.objects.contains_key(key) {
get_or_spawn!(self, key.clone());
}
}
let iter = list.into_iter().filter_map(|key| self.objects.get(&key));
self.visit_multiple(envelope, visitor, iter);
}
Outcome::GentleMulticast(list) => {
Expand Down

0 comments on commit 7e56faf

Please sign in to comment.