java.util.concurrent · java.base · since Java 1.5

BlockingQueue

declaration
public interface BlockingQueue<E> extends Queue<E>

Queue with blocking put/take — the producer-consumer conveyor with built-in backpressure and safe publication. Bounded implementations are the overload valve.

Key methods

void put(E e)Block until space (bounded queues).
E take()Block until an element arrives.
boolean offer(E, long timeout, TimeUnit)Bounded-wait insert — the load-shedding hook.
E poll(long timeout, TimeUnit)Bounded-wait removal.
int drainTo(Collection<E>)Bulk transfer for batch consumers.