The initial plan to get the current stats of active users and vehicles was to directly get the .len() of the sessions & rooms hashmaps in the Lobby. However, as Lobby is an actor, there is no way to get those from the Manager.
But since the lobby is declared as Addr<Lobby> in Manager, it becomes impossible to invoke the method here
src/manager.rs
impl Manager {
pub async fn joinvehicle(
// ... all the args
) -> HttpResponse {
// this method doesn't exist obviously
let temp = self.lobby.active_users();
}
}
There doesn't seem to be a solution to this problem as actix::Addr<A> doesn't currently have any valid implementation to expose A, as mentioned in this Stack Overflow post.
The initial plan to get the current stats of active users and vehicles was to directly get the
.len()
of thesessions
&rooms
hashmaps in theLobby
. However, asLobby
is an actor, there is no way to get those from theManager
.sockets/lobby.rs:
But since the lobby is declared as
Addr<Lobby>
inManager
, it becomes impossible to invoke the method heresrc/manager.rs
There doesn't seem to be a solution to this problem as
actix::Addr<A>
doesn't currently have any valid implementation to exposeA
, as mentioned in this Stack Overflow post.