Experimenting with distributed nodes. Wish I had more logging!

This commit is contained in:
Dave Hrycyszyn
2024-06-06 11:49:45 +01:00
parent 5c1420534c
commit 14913b28cd
3 changed files with 24 additions and 14 deletions

View File

@@ -24,9 +24,12 @@ fn main() {
client_id, message
);
// retrieve this client's `Responder`:
let responder = clients.get(&client_id).unwrap();
// echo the message back:
responder.send(message);
// let responder = clients.get(&client_id).unwrap();
let all_clients = clients.keys().collect::<Vec<_>>();
for client in all_clients {
let other_responder = clients.get(client).unwrap();
other_responder.send(message.clone());
}
}
}
}