com.undefinedlabs.scope.deps.okhttp3.internal.http2.PushObserver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scope-deps Show documentation
Show all versions of scope-deps Show documentation
Scope is a APM for tests to give engineering teams unprecedented visibility into their CI process to quickly
identify, troubleshoot and fix failed builds.
This artifact contains dependencies for Scope.
package com.undefinedlabs.scope.deps.okhttp3.internal.http2;
import com.undefinedlabs.scope.deps.okio.BufferedSource;
import java.io.IOException;
import java.util.List;
public interface PushObserver {
/**
* Describes the request that the server intends to push a response for.
*
* @param streamId server-initiated stream ID: an even number.
* @param requestHeaders minimally includes {@code :method}, {@code :scheme}, {@code :authority},
* and {@code :path}.
*/
boolean onRequest(int streamId, List requestHeaders);
/**
* The response headers corresponding to a pushed request. When {@code last} is true, there are
* no data frames to follow.
*
* @param streamId server-initiated stream ID: an even number.
* @param responseHeaders minimally includes {@code :status}.
* @param last when true, there is no response data.
*/
boolean onHeaders(int streamId, List responseHeaders, boolean last);
/**
* A chunk of response data corresponding to a pushed request. This data must either be read or
* skipped.
*
* @param streamId server-initiated stream ID: an even number.
* @param source location of data corresponding with this stream ID.
* @param byteCount number of bytes to read or skip from the source.
* @param last when true, there are no data frames to follow.
*/
boolean onData(int streamId, BufferedSource source, int byteCount, boolean last)
throws IOException;
/** Indicates the reason why this stream was canceled. */
void onReset(int streamId, ErrorCode errorCode);
PushObserver CANCEL = new PushObserver() {
@Override public boolean onRequest(int streamId, List requestHeaders) {
return true;
}
@Override public boolean onHeaders(int streamId, List responseHeaders, boolean last) {
return true;
}
@Override public boolean onData(int streamId, BufferedSource source, int byteCount,
boolean last) throws IOException {
source.skip(byteCount);
return true;
}
@Override public void onReset(int streamId, ErrorCode errorCode) {
}
};
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy