All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.redis.spring.batch.reader.PollableItemReader Maven / Gradle / Ivy

There is a newer version: 4.0.7
Show newest version
package com.redis.spring.batch.reader;

import java.util.concurrent.TimeUnit;

import org.springframework.batch.item.ItemStreamReader;

public interface PollableItemReader extends ItemStreamReader {

    /**
     * Tries to read a piece of input data. If such input is available within the given duration, advances to the next one
     * otherwise returns null.
     * 
     * @param timeout how long to wait before giving up, in units of {@code unit}
     * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter
     * @throws InterruptedException if interrupted while waiting
     * @return T the item to be processed or {@code null} if the specified waiting time elapses before an element is available
     * @throws PollingException if an exception occurred while polling
     */
    T poll(long timeout, TimeUnit unit) throws InterruptedException, PollingException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy