concept client in category akka

This is an excerpt from Manning's book Reactive Design Patterns.
Consensus-based replication is needed within the system as an implementation detail of sharding by user ID, because the relocation of a shard must be recorded accurately and consistently for all clients. It would lead to user-visible distortions like an email disappearing and then reappearing if a client were to flip-flop between decommissioned and live replicas.
Listing 2.1. Excerpt from a simple controller for an image service
public interface Images { Image get(String Key); void add(String key, Image image); } public Images cache; #1 public Images database; #2 Image result = cache.get(key); if (result != null) { return result; #3 } else { result = database.get(key); if (result != null) { cache.add(key, result); #4 return result; } else { return fallback; #5 } } #1 - Assumed thread-safe #2 - Wraps a database connection pool #3 - Image is found in the cache #4 - Image is found in the database, added to the cache, and returned to the client #5 - Image is not retrieved from the database
Figure B.2. Data are flowing from the clients that submit their position updates through a front end that handles the client connections into the map tiles and on to those clients that are watching the map.
![]()
In the example application, you could define that each user sends one position update every 5 seconds while the app is running on their mobile device—phone, tablet, or watch. You can ascertain that by writing the client app yourself or by enforcing this limit in the API that the application offers to the author of client apps. Each position update will amount to roughly 100 bytes, give or take (10 bytes each for timestamp, latitude, and longitude; 40 bytes for lower-level protocol overhead, such as TCP/IPv4; plus additional space for encryption, authentication, and integrity data). Factoring in some overhead for congestion avoidance and message scheduling between multiple clients, you will assume that each client’s position-update stream costs roughly 50 bytes per second on average.

This is an excerpt from Manning's book Reactive Web Applications: With Play, Akka, and Reactive Streams.
One of the main features of the web application for sharing funny videos is to show those videos to visitors. If we were to store the videos on a third-party storage service, such as Amazon S3, and display them using a video player on our site, we’d have to stream the video to the client through our server. If, however, the client’s bandwidth was not as good as that of our server (which is often the case, especially for mobile devices), we’d need to keep the video in memory on the server for the duration of the streaming. With many users watching videos at the same time, we’d certainly run out of memory very quickly. Back pressure propagation is a means of regulating the speed of streams by taking into account the effective consumption speed on the consumer side. Instead of keeping the entire video in memory on our server, a setup involving back pressure would allow us to modulate the speed at which the data is retrieved from Amazon S3 so we’d only buffer a small amount in memory on the server, fetching more of it as the video is played on the user’s phone.
In the previous chapter, we talked about the key benefits of adopting a reactive approach to web application design and operation, and you saw that the Play Framework is a good technology for this. Now it’s time to get your hands dirty and build a reactive web application. We’ll build a simple application that connects to the Twitter API to retrieve a stream of tweets and send them to clients using WebSockets.
Finally, you can make use of this method in your actor when a client subscribes.