Skip to content

Commit

Permalink
chore: make server streaming transformer safer
Browse files Browse the repository at this point in the history
Change-Id: I0fed7ea426a4b775a7fe5e661ed8e67f1faa53eb
  • Loading branch information
igorbernstein2 committed Nov 5, 2024
1 parent 6685aa3 commit d6b9b1f
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,24 @@ public void call(

inner.call(
innerReq,
new ResponseObserver<InnerRespT>() {
new SafeResponseObserver<InnerRespT>(outerObserver) {
@Override
public void onStart(StreamController streamController) {
public void onStartImpl(StreamController streamController) {
outerObserver.onStart(streamController);
}

@Override
public void onResponse(InnerRespT innerResp) {
public void onResponseImpl(InnerRespT innerResp) {
outerObserver.onResponse(responseTransformer.apply(innerResp));
}

@Override
public void onError(Throwable throwable) {
public void onErrorImpl(Throwable throwable) {
outerObserver.onError(throwable);
}

@Override
public void onComplete() {
public void onCompleteImpl() {
outerObserver.onComplete();
}
},
Expand Down

0 comments on commit d6b9b1f

Please sign in to comment.