com.yahoo.processing.response.IncomingData Maven / Gradle / Ivy
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.processing.response;
import com.yahoo.processing.impl.ProcessingFuture;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
/**
* A data list own once instance of this which can be used to provide data asynchronously to the list,
* and consume, wait for or be notified upon the arrival of such data.
*
* @author bratseth
*/
public interface IncomingData {
/**
* Returns the owner (target DataList) of this.
* Note that accessing the owner from the thread producing incoming data
* is generally *not* thread safe.
*/
DataList getOwner();
/**
* Returns a future in which all the incoming data that will be produced in this is available.
* Listeners on this are invoked on the thread producing the incoming data (or a thread spawned from it),
* which in general is separate from the thread using the data list. Hence, listeners on this even cannot
* in general assume that they may modify the data list or the request.
*
* The data is not {@link #drain drained} into the owner of this by this method. That must be done
* by the thread using the data list.
*
* This return the list owning this for convenience.
*/
CompletableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy