liveBook · Manning

Intermediate process

As explained in Elixir in Action, Third Edition

An intermediate process is a coordinating process that accepts requests, queues or processes them, and later reports their status.

An intermediate process accepts a request, immediately confirms that it was queued, processes it later, and sends a subsequent status notification. It preserves more responsiveness than synchronous calls while providing more certainty than casts. section 11.3.4

Use the pattern when:

  • End-to-end operations are slow or system load is high. section 11.3.4
  • The queue can act as a congestion boundary by refusing additional requests when it becomes overloaded. section 11.3.4
  • Plain calls are insufficient for responsiveness, but casts provide too little certainty. section 11.3.4

To-do entry request

A client submits a to-do entry and receives confirmation that the request entered the queue. The intermediate process attempts storage through database workers, then reports success or failure. For more complex pipelines, GenStage can coordinate producers and consumers. section 11.3.4

Figure 11.6 Queuing the request and sending a notification about the status
CH11_F06_Juric3

Trace the separation between immediate queue confirmation and later request-status notification. section 11.3.4

How Elixir in Action, Third Edition covers it

How deep it goes
Explains queuing, delayed processing, notifications, overload refusal, and trade-offs, but does not provide implementation code.
Examples
Uses a to-do entry, database workers, an accumulating queue, and a later request-status notification.
What it assumes
Assumes familiarity with synchronous calls, casts, request queues, and database-worker throughput.
What you can do after
Apply the pattern by choosing calls, casts, or an intermediate process according to load, latency, and certainty requirements.
How it connects
Connects synchronous calls, casts, database workers, queues, and GenStage producer-consumer pipelines.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elixir in Action, Third Edition. The section links point to the parts of the book it draws on.