Class SyncFeedClient

  • All Implemented Interfaces:
    AutoCloseable

    public class SyncFeedClient
    extends Object
    implements AutoCloseable
    A utility wrapper of a FeedClient which feeds a list of documents and blocks until all responses are returned, before returning the results. Not multithread safe: A sync feed client instance can only be used by a single thread (but it can and should be reused for multiple subsequent synchronous calls).
    Author:
    bratseth
    • Constructor Detail

      • SyncFeedClient

        public SyncFeedClient​(SessionParams params)
    • Method Detail

      • stream

        public SyncFeedClient.SyncResult stream​(List<SyncFeedClient.SyncOperation> operations)
        Calls FeedClient.stream for each entry in the list, blocks until all results are ready and returns them. This will block for at most the time it takes to feed these operations + clientTimeout given in the sessions params when creating this.
        Parameters:
        operations - the Vespa write operations to stream
        Returns:
        the result of feeding all these operations