10 Long-running operations

This chapter covers

  • How to use long-running operations for non-immediate API calls
  • Storing metadata about operational progress
  • Where operations should live in the resource hierarchy
  • Finding operation status (including error results) via polling and blocking
  • Interacting with running operations (e.g., pausing, resuming, and canceling)

In most cases, incoming requests can be processed quickly, generating a response within a few hundred milliseconds after the request is received. In the cases where responses take significantly longer, the default behavior of using the same API structure and asking users to “just wait longer” is not a very elegant option. In this chapter, we’ll explore how to use long-running operations ...

Get API Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.