liveBook · Manning

Job

As explained in API Design Patterns

A job is an API resource that stores configuration for work and exposes a separate operation for executing that work.

A job is a resource that stores work configuration separately from execution. Create and configure it once, then invoke its parameterless run method whenever the work should occur. section 11.2

Use the split between configuration and execution to:

  • Avoid repeating increasingly large configuration payloads. section 11.2
  • Grant configuration and execution permissions independently. section 11.2
  • Support scheduling by invoking one parameterless method. section 11.2
  • Keep execution inputs on the job; run should accept only the job identifier. section 11.3.2

Rerunnable backup job

Create and configure a backupChatRoomJob, then call POST /backupChatRoomJobs/{id}:run. The call returns a long-running operation whose response can contain a destination and whose metadata can report messages counted, messages processed, and bytes written. section 11.3.2

Figure 11.1 Interaction with a Job resource

Follow the interaction sequence from job creation and configuration to later execution. section 11.2

How API Design Patterns covers it

How deep it goes
Defines resource creation and run behavior, including request constraints, long-running operations, and varied output handling.
Examples
Uses rerunnable backup jobs with run requests, operation metadata, destinations, and execution sequences.
What you can do after
Build and operate a rerunnable resource whose persisted configuration is executed through a parameterless custom method.
How it connects
Connects resources, custom methods, long-running operations, execution resources, access control, and scheduling.

Also explained in

Compare how 4 books explain job →

Related concepts

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