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

io.descoped.rawdata.discard.DiscardingRawdataConsumer Maven / Gradle / Ivy

The newest version!
package io.descoped.rawdata.discard;

import io.descoped.rawdata.api.RawdataClosedException;
import io.descoped.rawdata.api.RawdataConsumer;
import io.descoped.rawdata.api.RawdataMessage;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;

class DiscardingRawdataConsumer implements RawdataConsumer {

    final String topic;

    DiscardingRawdataConsumer(String topic) {
        this.topic = topic;
    }

    @Override
    public String topic() {
        return topic;
    }

    @Override
    public RawdataMessage receive(int timeout, TimeUnit unit) throws RawdataClosedException {
        return null;
    }

    static final CompletableFuture COMPLETED = CompletableFuture.completedFuture(null);

    @Override
    public CompletableFuture receiveAsync() {
        return COMPLETED;
    }

    @Override
    public void seek(long timestamp) {
    }

    @Override
    public boolean isClosed() {
        return false;
    }

    @Override
    public void close() {
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy