Synchronous Method
Synchronous methods provide the result at the site of the request no matter how long it takes at the time of the request.
When this method is called, the operation of the main thread is stopped until the return value is returned.
Unlike asynchronous methods, this method is called sequentially, so there is no chance of it getting out of order, and there is no chance of errors being thrown by other threads during operation, giving reliable results.
Precautions when using BACKND synchronous methods
When calling a method to load large data such as game information, charts, or ranking information, it may take a long time to receive a response value because the server must process a lot of data.
The game may appear to have stopped due to the suspension of the process before response because when the method is called, the main thread has to wait for the method response value.
In addition, even if the method is reading a small amount of data, you may see a short disconnection for every call because it takes some time to send the request and receive a response.
Therefore, it is recommended to not use synchronous methods, and it should only be used when calling functions that must be carried out properly.
Situations where synchronous methods are called
- Functions related to login such as login and token renewal
- Functions related to charging, such as payment receipt verification and provision of paid items
Situations where synchronous methods should not be called
- Functions that load a lot of data, such as game information, charts, and ranking
- Functions that are called frequently in the game, such as game saving