liveBook · Manning

Source.queue

As explained in Akka in Action, Second Edition

Source.queue is an Akka Streams source-construction operation that exposes a queue for asynchronously adding elements to a running stream.

Source.queue creates a stream source whose elements can be added after the stream starts. Materialize it with toMat and Keep.left to obtain a BoundedSourceQueue or SourceQueue, then call offer(elem) from other parts of the application. section 16.4

Configure queue capacity and observe overflow behavior:

  • Set bufferSize because the queue is bounded; with the default BoundedSourceQueue strategy, new elements are dropped when the buffer is full. section 16.4

How Akka in Action, Second Edition covers it

How deep it goes
Explains construction, materialization, offering, capacity, overflow strategies, and observable enqueue or drop results.
Examples
Demonstrates integer offers, doubling through map, throttling, printed output, and explicit enqueue or drop reporting.
What it assumes
Uses stream sources, sinks, materialized values, and basic Akka Streams composition without establishing them from zero.
What you can do after
Operate a running Akka Streams pipeline through Source.queue, select overflow behavior, and diagnose dropped offers.
How it connects
Connects Source.queue with Source, Sink, materialization, SourceQueue, BoundedSourceQueue, and OverflowStrategy.

Related concepts

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