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

org.webpieces.http2client.impl.Proxy2StreamRef Maven / Gradle / Ivy

There is a newer version: 2.1.109
Show newest version
package org.webpieces.http2client.impl;

import org.webpieces.util.futures.XFuture;

import com.webpieces.http2.api.dto.lowlevel.CancelReason;
import com.webpieces.http2.api.streaming.StreamRef;
import com.webpieces.http2.api.streaming.StreamWriter;

public class Proxy2StreamRef implements StreamRef {

	private StreamRef ref;
	private XFuture writer;

	public Proxy2StreamRef(StreamRef ref, XFuture writer) {
		this.ref = ref;
		this.writer = writer;
	}

	@Override
	public XFuture getWriter() {
		return writer;
	}

	@Override
	public XFuture cancel(CancelReason reason) {
		if(ref != null)
			return ref.cancel(reason);
		
		return XFuture.completedFuture(null);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy