Hello the Async part is quite well Understandable, but how do they combine the sync part , when the user see the other player moves when he stay in the current session . does it make poll requests every N seconds? what is the architecture of the server behind such game that mix Async and Sync game
"with friends" type games are pretty much only pseudo synchonous. Completed turns get pushed to their opponent, if the opponent happens to be online at the time it feels ... n'sync (sorry I had to).
Thanks for your answer , i will try to clarify more . what i mean Async is ( again chess with friends example ) 1. user adding Competitors <- async request 2. user go to Competitor no' 1 make move -> async request now here is my problem ( what you call "pseudo synchonous" ) if user stay in the chess board he can see the Competitor move his Chess Soldier so this is the sync part . so while im writing this , i guess when the user in this state the client start to make small polling requests . ... or not . also the chat option this is for sure synchonous i just what to learn more about this type of architecture .
Either way, the turn is pushed to the opponent. Polling, then pulling if needed, just adds traffic that is unnecessary. Chat is also pushed, why would it be any different. Imagine: Player A and B in a game. Player B is online, or offline, it doesn't really matter. Player A completes his turn. A 'TurnComplete' notification is sent to player B's device. Player B receives the 'TurnComplete' notification and, whenever he's online next (or if he's online now), displays the action player a took.
well this is what im talking about the sync part , when player B is online how does he get the posh notification if no connection is open ? he have to do request to get update ,
I think your app can receive push notifications while it's open (without showing the user). A more complicated alternative would be to implement websockets or use third party supporting them.