liveBook · Manning

Asynchronous programming

As explained in Fast by Default

Asynchronous execution is running work independently of the immediate caller so the caller can continue without waiting for completion.

Asynchronous programming moves work beyond the immediate interaction so callers can continue without waiting for completion. It keeps critical paths responsive by acknowledging intent first and finishing secondary work afterward. section 4.3 section 5.2

Apply the pattern by separating immediate user-visible work from deferred operations:

  • Acknowledge input immediately with visual feedback, then process the request in the background. section 4.2.3
  • Defer analytics, logging, cache updates, notifications, synchronization, and below-fold content when users do not need to observe completion. section 4.3
  • Keep payment, authentication, and file-save completion on the immediate path when success must be guaranteed before confirmation. section 4.3
  • Route background jobs by urgency into separate worker pools, preventing low-priority bursts from delaying user-visible work. section 4.5.5

Instant response, delayed completion

When a user moves a task on a project board, update its visual position within the interaction budget. Validate the move, persist it, notify connected users, and recalculate summaries asynchronously so the interface feels immediate while state catches up. section 6.2.7

Message queues decouple producers from consumers and let each operate at its own pace. Traditional queues distribute tasks to one consumer, while event streams retain events for independent consumers and replay. section 5.3.5

Asynchronous designs require coordination and error handling, including a way to communicate completion. Polling suits simple status checks, WebSockets provide live updates, and email fits long-running jobs. section 4.5.5 section 5.2

How Fast by Default covers it

How deep it goes
Explains deferral choices, non-deferrable work, worker-pool routing, queues, status communication, and coordination trade-offs.
Examples
Uses mobile transfers, deferred web content, background jobs, purchase processing, event streams, and project-board interactions.
What you can do after
Apply it by designing responsive interactions, routing background jobs, choosing status mechanisms, and separating urgent from deferred work.
How it connects
Connects asynchronous programming with critical paths, lazy loading, optimistic updates, progressive rendering, worker processes, and message queues.

Also explained in

Compare how 37 books explain asynchronous programming →

Related concepts

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