---
title: 'Google Guava: EvictingQueue in Version 15'
url: 'https://tutego.de/blog/javainsel/2013/08/google-guava-evictingqueue-in-version-15'
markdown: 'https://tutego.de/blog/javainsel/2013/08/google-guava-evictingqueue-in-version-15.md'
date: '2013-08-20'
description: 'Google Guava hat Folgendes ursprünglich geteilt: EvictingQueue: a non-blocking, bounded queue In Guava 15, we are introducing EvictingQueue [1], which is a non-blocking, bounded queue that automatically evicts (removes) elements from the head of the queue when attempting to add elements to a full …'
taxonomy:
  category:
    - 'Guava/Google Core Libraries'
    - 'Open Source'
---

# Google Guava: EvictingQueue in Version 15

![Illustration einer tropischen Insel mit Palmen und einem hohen Berg](https://tutego.de/blog/javainsel/user/themes/tutego/images/insel-cover.jpg)# Java Blog für Programmierer

[Java Blog für Programmierer](https://tutego.de/blog/javainsel/)

## Google Guava: EvictingQueue in Version 15

20.08.2013 · [Christian Ullenboom](https://tutego.de/blog/javainsel/author/admin/)

[Google Guava](https://plus.google.com/118010414872916542489) [hat Folgendes ursprünglich geteilt](https://plus.google.com/118010414872916542489/posts/QVqQGiSppF3):

> **EvictingQueue: a non-blocking, bounded queue**In Guava 15, we are introducing EvictingQueue \[1\], which is a non-blocking, bounded queue that automatically evicts (removes) elements from the head of the queue when attempting to add elements to a full queue. This is different from conventional bounded queues, which either block or reject new elements when full. Java provides several Queue implementations, depending on what features you need. For example: Unbounded, non-blocking: ArrayDeque, `LinkedList`, PriorityQueue Unbounded, blocking: LinkedBlockingDeque, LinkedBlockingQueue, SynchronousQueue Bounded, blocking: ArrayBlockingQueue, LinkedBlockingDeque, LinkedBlockingQueue However, a bounded, non-blocking implementation is noticeably missing from the JDK. Like many of the JDK implementations, EvictingQueue is *not* thread-safe and does *not* permit `null` elements. If you need thread safety, you must wrap it in a synchronized wrapper (Queues#`synchronizedQueue`). If you need `null` elements, please give this wiki page \[2\] a read. An EvictingQueue can be used to keep track of recent items in a bounded buffer, or even as a simple FIFO cache. Hopefully you’ll find it useful! Cheers, -+[Kurt Alfred Kluever](https://plus.google.com/104176937291281778869), Guavian \[1\]
> \[2\]

Kategorien: [Guava/Google Core Libraries](https://tutego.de/blog/javainsel/category/guava-google-core-libraries/), [Open Source](https://tutego.de/blog/javainsel/category/open-source/)

## 1 Kommentare

**Interesting Java-related links for September 2 - September 8, 2013 - Softteco** · [13.11.2014 21:13](#comment-65806)

\\\[…\\\] http://www.tutego.de/blog/javainsel/2013/08/google-guava-evictingqueue-in-version-15/ – Some Guava goodness \\\[…\\\]

Die bisherigen Kommentare wurden aus WordPress übernommen. Neue Kommentare sind derzeit geschlossen.

[← Alle Beiträge](https://tutego.de/blog/javainsel/)

---

## Navigation

- Previous: [Link: Schöne Range-Klasse für Java 8](https://tutego.de/blog/javainsel/2013/08/link-schne-range-klasse-fr-java-8.md)
- Next: [JMS 2.0 Änderungen](https://tutego.de/blog/javainsel/2013/08/jms-2-0-nderungen.md)
