Example usage for java.util.concurrent BlockingDeque offer

List of usage examples for java.util.concurrent BlockingDeque offer

Introduction

In this page you can find the example usage for java.util.concurrent BlockingDeque offer.

Prototype

boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException;

Source Link

Document

Inserts the specified element into the queue represented by this deque (in other words, at the tail of this deque), waiting up to the specified wait time if necessary for space to become available.

Usage

From source file:org.fim.internal.StateGenerator.java

private void enqueueFile(BlockingDeque<Path> filesToHashQueue, Path file) {
    try {/*from  w  w  w . j  ava2s  . co m*/
        filesToHashQueue.offer(file, 120, TimeUnit.MINUTES);
    } catch (InterruptedException ex) {
        Logger.error("Exception while enqueuing file '" + file + "'", ex, context.isDisplayStackTrace());
    }
}