Async operation / uncertainty

Systems and interaction

I made this little simulation for a conversation with a collaborator at the research centre about why message delivery matters in our joint project. It’s simple, but I thought it was worth sharing here.

What does the system actually know while an operation is pending?

A small playground for the gap between what the server has done and what the client can confirm. Follow the messages, change a strategy, and watch the two sides build different versions of the same operation.

Choose a scenario and press Run. Simulation speed changes playback, not the behaviour being tested. Once a run finishes, move across the timeline to inspect it, or click to replay from that moment. On touch screens, slide a finger across the rows to inspect.

Communication and recovery

Create a task, follow the request, then lose the confirmation and compare ways to recover without repeating the work. A timeout means the client stopped waiting; the work may already be done.1

Client

Ready to send

0.00 s

Server

Waiting for a request

Create a task and follow its round trip: request, server processing, response. The client only confirms creation when the response arrives.

Events

No events yet.

Lifecycle and coordination

A request can arrive correctly and still need care: the client cancels, an older response arrives last, several operations overlap, or the server accepts work that is not finished yet.

Cancel the client-side request without assuming that server work has been undone.2 Compare a latest-only guard for search results with independent creations, where both results matter. Then follow a job through acceptance, background work and status polling: accepted is not completed, and checking status is not repeating the creation.3

Client

Ready to send

0.00 s

Server

Waiting for a request

The client aborts a dispatched request. It stops waiting and ignores the response, but this does not undo work already running on the server. Change when the client cancels.

Events

No events yet.

The server is visible here so the differences can be inspected; a real frontend does not have that view. Dots represent request and response messages, not individual network packets. Timings and failures are simplified, and no real requests are sent.

References

  1. 1

    Amazon Builders' Library, Timeouts, retries, and backoff with jitter. Covers timeout semantics, retry side effects, exponential backoff and idempotent operations

  2. 2

    MDN Web Docs, AbortController. Documents client-side cancellation of fetch requests, response-body consumption and streams

  3. 3

    HTTP Semantics, RFC 9110 § 15.3.3: 202 Accepted. Defines acceptance for processing as distinct from completion of processing