Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
fix(generator): delay removing streaming response until used (#56)
Browse files Browse the repository at this point in the history
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 fb49f52 commit b82e4ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Expand Up @@ -59,11 +59,12 @@ public void reset() {
@Override
public StreamObserver<StreamingTranslateSpeechRequest> streamingTranslateSpeech(
final StreamObserver<StreamingTranslateSpeechResponse> responseObserver) {
final Object response = responses.remove();
StreamObserver<StreamingTranslateSpeechRequest> requestObserver =
new StreamObserver<StreamingTranslateSpeechRequest>() {
@Override
public void onNext(StreamingTranslateSpeechRequest value) {
requests.add(value);
final Object response = responses.remove();
if (response instanceof StreamingTranslateSpeechResponse) {
responseObserver.onNext((StreamingTranslateSpeechResponse) response);
} else if (response instanceof Exception) {
Expand Down
6 changes: 3 additions & 3 deletions synth.metadata
Expand Up @@ -4,15 +4,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/java-mediatranslation.git",
"sha": "a9a290206a5f8cddf1e0420f506b51c4bee935d8"
"sha": "fb49f5211dbf116a9631a01bfe15bfcfe7583187"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "d741cd976975c745d0199987aff0e908b8352992",
"internalRef": "305561906"
"sha": "28e76243c23cc282efbb288cb558c174e3e5e9ee",
"internalRef": "308294748"
}
},
{
Expand Down

0 comments on commit b82e4ee

Please sign in to comment.