You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Lobby can't contain a db field, it is impossible to pair a vehicle to it's user through it. The application requirements state that a user & vehicle should be able to use a single websocket connection to execute the pair. This is necessary to implement QR code pairing at the client side.
The default() method doesn't support args
implDefaultforLobby{// default() can't take argsfndefault(db:Database) -> Lobby{Lobby{db_instance: db,sessions:Hashmap::new(),rooms:Hashmap::new()}}}
There is no way to make the default() method async in Lobby, or anywhere basically.
implDefaultforLobby{// this throws an errorasyncfndefault() -> Lobby{// async code to spin up a new connection to dbLobby{
db_instnace: <db_object>,sessions:Hashmap::new(),rooms:Hashmap::new()}}}
The text was updated successfully, but these errors were encountered:
I also tried using actix_web::rt::spawn() to move the database operations directly into Handler<Connect> for Lobby, but can't access the self of Lobby inside the spawned closure.
actix_web::rt::spawn(async{// make db updates hereself.send_disconnect(&*message,&msg.self_id,CloseCode::Normal);});
This method would've worked as we could check everything before initiating the pair.
Since
Lobby
can't contain adb
field, it is impossible to pair a vehicle to it's user through it. The application requirements state that a user & vehicle should be able to use a single websocket connection to execute the pair. This is necessary to implement QR code pairing at the client side.The
default()
method doesn't support argsThere is no way to make the
default()
methodasync
inLobby
, or anywhere basically.The text was updated successfully, but these errors were encountered: