Skip to content
Permalink
Browse files
fix(generator): delay removing streaming response until used (#166)
PiperOrigin-RevId: 308294748

Source-Author: Google APIs <noreply@google.com>
Source-Date: Fri Apr 24 11:44:16 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 28e76243c23cc282efbb288cb558c174e3e5e9ee
Source-Link: googleapis/googleapis@28e7624
  • Loading branch information
yoshi-automation committed Apr 25, 2020
1 parent 8fe074c commit fef1a16937ff81ea96e8504b053289d2025d8a21
@@ -90,11 +90,12 @@ public void longRunningRecognize(
@Override
public StreamObserver<StreamingRecognizeRequest> streamingRecognize(
final StreamObserver<StreamingRecognizeResponse> responseObserver) {
final Object response = responses.remove();
StreamObserver<StreamingRecognizeRequest> requestObserver =
new StreamObserver<StreamingRecognizeRequest>() {
@Override
public void onNext(StreamingRecognizeRequest value) {
requests.add(value);
final Object response = responses.remove();
if (response instanceof StreamingRecognizeResponse) {
responseObserver.onNext((StreamingRecognizeResponse) response);
} else if (response instanceof Exception) {
@@ -90,11 +90,12 @@ public void longRunningRecognize(
@Override
public StreamObserver<StreamingRecognizeRequest> streamingRecognize(
final StreamObserver<StreamingRecognizeResponse> responseObserver) {
final Object response = responses.remove();
StreamObserver<StreamingRecognizeRequest> requestObserver =
new StreamObserver<StreamingRecognizeRequest>() {
@Override
public void onNext(StreamingRecognizeRequest value) {
requests.add(value);
final Object response = responses.remove();
if (response instanceof StreamingRecognizeResponse) {
responseObserver.onNext((StreamingRecognizeResponse) response);
} else if (response instanceof Exception) {
@@ -4,23 +4,23 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-speech.git",
"sha": "6dee1350b47734f3dfff19e3f3fa81a1d502253b"
"sha": "8fe074c183d0521a4ea645c3c498248b33d7debd"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "4d61e1cb40184a7ad63ef37b1813f6608718674a",
"internalRef": "306280989"
"sha": "28e76243c23cc282efbb288cb558c174e3e5e9ee",
"internalRef": "308294748"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "4d61e1cb40184a7ad63ef37b1813f6608718674a",
"internalRef": "306280989"
"sha": "28e76243c23cc282efbb288cb558c174e3e5e9ee",
"internalRef": "308294748"
}
},
{

0 comments on commit fef1a16

Please sign in to comment.