An asynchronous server accepts connections and monitors slow input without holding other clients while one connection waits. It can improve efficiency without parallelism, and remains distinct from single-threaded, multithreaded, or multiprocess execution. section 3.1
A practical implementation combines request reception with explicit lifecycle management:
- Start an asyncio server that accepts client connections and receives MapReduce requests containing data and code. section 3.1
- Use a worker thread and process pool for request processing while the asynchronous server continues serving clients. section 3.5.2
- Handle interruption through the event loop, cancel serving, wait for shutdown, and signal the worker to terminate. section 3.5.2
Slow client input
A synchronous single-process server can leave every other client waiting when one user takes a long time to submit a request; an asynchronous design monitors that connection instead. section 3.1
Figure 3.2 Several architectures covering synchronous single-process/thread, synchronous multiprocess, and asynchronous single-process implementations for a server
Compare synchronous single-process and multiprocess architectures with an asynchronous single-process server. section 3.1
