Skip to content

Commit decae73

Browse files
Stream method call add status events listen (#7)
call add status events listen for support in some database (for example Dremio arrow flight SQL )
1 parent fbf79da commit decae73

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/grpc_util.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ export class Stream<GrpcOutput, StreamOutput> {
120120
}
121121
this.responses_.push({ data });
122122
});
123+
call.on("status", (status: { code: number; metadata: GrpcMetadata }) => {
124+
if (status.code === 0) {
125+
this.responses_.push({ metadata: new Metadata(status.metadata) });
126+
}
127+
});
123128
call.on("metadata", (metadata: GrpcMetadata) => {
124129
this.responses_.push({ metadata: new Metadata(metadata) });
125130
});

0 commit comments

Comments
 (0)