The Problem and the Approach
The main problem with network operations is time. A network operation will always take some amount of time, and usually the developer wants the user to wait for that network operation to finish before moving on to another task. Users rarely want to wait for an application.
To compound this problem, that amount of time is variable. The developer has no way of knowing if the user is on a fast network or a slow network. Just knowing whether the user is using cellular or Wi-Fi is insufficient. Cellular can be fantastic and Wi-Fi can be terrible.
The basic answer to this problem is that network operations need to be asynchronous. The developer needs to write the networking code in such a way that the network operation ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access