Abstract the disableAutoFlowControl method of CallStreamObserver (#10406)

* Abstract the disableAutoFlowControl method of CallStreamObserver

* Abstract the disableAutoFlowControl method of CallStreamObserver
This commit is contained in:
Kunshuai Zhu 2022-08-04 20:24:53 +08:00 committed by GitHub
parent 16fc7b55ef
commit beeca4a4ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 5 deletions

View File

@ -29,6 +29,8 @@ public interface ClientStreamObserver<T> extends CallStreamObserver<T> {
* request()} may not be called before the call is started, a number of initial requests may be
* specified.
*/
void disableAutoRequest();
default void disableAutoRequest() {
disableAutoFlowControl();
}
}

View File

@ -21,7 +21,8 @@ import org.apache.dubbo.rpc.protocol.tri.observer.CallStreamObserver;
public interface ServerStreamObserver<T> extends CallStreamObserver<T> {
void disableAutoInboundFlowControl();
default void disableAutoInboundFlowControl() {
disableAutoFlowControl();
}
}

View File

@ -43,5 +43,12 @@ public interface CallStreamObserver<T> extends StreamObserver<T> {
*/
void setCompression(String compression);
/**
* Swaps to manual flow control where no message will be delivered to {@link
* StreamObserver#onNext(Object)} unless it is {@link #request request()}ed. Since {@code
* request()} may not be called before the call is started, a number of initial requests may be
* specified.
*/
void disableAutoFlowControl();
}

View File

@ -76,7 +76,7 @@ public class ClientCallToObserverAdapter<T> extends CancelableStreamObserver<T>
}
@Override
public void disableAutoRequest() {
public void disableAutoFlowControl() {
call.setAutoRequest(false);
}
}

View File

@ -105,7 +105,7 @@ public class ServerCallToObserverAdapter<T> extends CancelableStreamObserver<T>
}
@Override
public void disableAutoInboundFlowControl() {
public void disableAutoFlowControl() {
call.disableAutoRequestN();
}