liveBook · Manning

Asynchronous programming

As explained in Amazon Web Services in Action, Third Edition: An in-depth guide to AWS

Asynchronous processing is a technique in which work is performed independently of the operation that initiates it and completed later.

Asynchronous processing lets work finish independently of the request that starts it. Instead of waiting for a result, the initiator can receive an ID or a link to check later. section 14.2.1 section 16.3

A queue-based workflow separates the request from the background work:

  • The web server places a message in SQS and returns a process ID or future result link. section 14.2.1
  • A worker receives the message, performs the task, and stores the result, such as an image in S3. section 14.2.5 section 16.3.3
  • After successful processing, the worker deletes the message to acknowledge completion. If a worker fails, the message can become available to another worker. section 14.2.5

Website screenshots and image filters

A URL-to-image service queues a URL, then a worker captures a screenshot and uploads a PNG for later retrieval. An image app similarly queues an uploaded image for background sepia filtering. Both workflows can add workers to handle growing queues; they also need a way to track whether each result is ready. section 14.2.1 section 16.3

Figure 14.6 The same process, but asynchronous

Compare the synchronous screenshot workflow with its queue-and-worker version. section 14.2.1

How Amazon Web Services in Action, Third Edition: An in-depth guide to AWS covers it

How deep it goes
Works through queue submission, worker processing, result storage, and message acknowledgement, but does not detail every operational failure mode.
Examples
Uses website screenshot generation and sepia-filtered image uploads as practical workflows.
What it assumes
Starts with the familiar request-response flow and introduces queues, workers, and process tracking through examples.
What you can do after
Apply the pattern with SQS queues and workers that store results in S3 and track image-processing state in DynamoDB.
How it connects
Connects message queues and workers with Amazon SQS, Amazon S3, DynamoDB, and process identifiers.

Also explained in

Compare how 28 books explain asynchronous programming →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Amazon Web Services in Action, Third Edition: An in-depth guide to AWS. The section links point to the parts of the book it draws on.