producer-consumer

A pattern where a producer creates data or work items and a consumer receives and processes them, usually with a queue or buffer between the two.

In more detail

The queue lets producer and consumer run at different speeds; problems start when the producer is persistently faster, which is what backpressure solves. Background worker pools, print spoolers and streaming pipelines follow this pattern. The consumer end of a data flow is also called the sink, and data flows downstream from producer to consumer.

Related terms

Taught in

References