I have a situation that one user need to communicate with another user.
e.g: UserA login and get certain authIdA. And UserB login and get authIdB. UserA need to know the authIdB to send chat to UserB, vice vera. They can’t be in the same session since each one has to login to do the communication. So I am wondering if there is a way to have a common “session variables”. So that when different users (sessions) login, they can get their authIds and write them to the common session variables. Also they can get other people’s authids to send chat messages.
The authIds can be changes each time when login. So using feeders before hand does not work.
In real world, how do real users exchange those authIds? Can’t you use the same mechanism?
In real worlds, it is very complicated involving the asyn calls to roster to get all the user that logged in (UI is also involved). To simplify scenario, we are just trying to track who is logged in and then send chat between those active uses. That is why I want to have a way to communicate between different users (sessions)
Then, the only way I see if to share a thread safe register object (ie singleton in Scala) where users would register once logged in, and select logged loggers to chat with.
Just write this object in your Simulation, make sure it’s threadsafe and call its methods in exec lambdas.
Sounds good, I will try this out