liveBook · Manning

MessageStore

As explained in Python Concurrency with asyncio

MessageStore is a book-local class that stores a bounded deque of output messages and invokes an asynchronous callback when items are appended.

MessageStore keeps output messages in a bounded deque and redraws the display whenever a new item arrives. Its asynchronous callback receives the current messages, separating storage from terminal rendering. section 8.4.1

Delay status display

A delay coroutine appends “Starting delay” before sleeping and “Finished delay” afterward. The callback redraws the stored messages while input remains available.

How Python Concurrency with asyncio covers it

How deep it goes
Defines the constructor and append flow, then applies them to delays and SQL queries without exposing deeper synchronization internals.
Examples
Uses delay status messages and an asynchronous command-line SQL client as practical applications.
What it assumes
Assumes familiarity with Python coroutines, awaitable callbacks, deques, and asynchronous terminal input.
What you can do after
Build it from scratch to retain bounded messages and trigger asynchronous redraws for interactive console applications.
How it connects
Connects deque storage, asynchronous callbacks, coroutines, terminal rendering, and database connection pools.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Python Concurrency with asyncio. The section links point to the parts of the book it draws on.