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

org.yamcs.client.base.AbstractStreamSender Maven / Gradle / Ivy

There is a newer version: 5.10.8
Show newest version
package org.yamcs.client.base;

import java.util.concurrent.CompletableFuture;

import org.yamcs.client.ClientException;
import org.yamcs.client.StreamSender;

import com.google.protobuf.Message;

public class AbstractStreamSender implements StreamSender {

    private BulkRestDataSender baseSender;

    public AbstractStreamSender(BulkRestDataSender baseSender) {
        this.baseSender = baseSender;
    }

    @Override
    public void send(ItemT message) {
        try {
            baseSender.sendData(message.toByteArray());
        } catch (ClientException e) {
            // TODO somehow emit to general future
            e.printStackTrace();
        }
    }

    @Override
    public CompletableFuture complete() {
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy