October 2018
Beginner to intermediate
466 pages
12h 2m
English
Because it is capable of handling many thousands of simultaneous connections, AsyncIO is very common for implementing servers. However, it is a generic networking library, and provides full support for client processes as well. This is pretty important, since many microservices run servers that act as clients to other servers.
Clients can be much simpler than servers, as they don't have to be set up to wait for incoming connections. Like most networking libraries, you just open a connection, submit your requests, and process any responses. The main difference is that you need to use await any time you make a potentially blocking call. Here's an example client for the sort service we implemented in the last section:
import ...