Skip to content

Commit

Permalink
Stream method call add status events listen (#7)
Browse files Browse the repository at this point in the history
call add status events listen for support in some database (for example
Dremio arrow flight SQL )
  • Loading branch information
rongfengliang authored Jan 7, 2025
1 parent fbf79da commit decae73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/grpc_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ export class Stream<GrpcOutput, StreamOutput> {
}
this.responses_.push({ data });
});
call.on("status", (status: { code: number; metadata: GrpcMetadata }) => {
if (status.code === 0) {
this.responses_.push({ metadata: new Metadata(status.metadata) });
}
});
call.on("metadata", (metadata: GrpcMetadata) => {
this.responses_.push({ metadata: new Metadata(metadata) });
});
Expand Down

0 comments on commit decae73

Please sign in to comment.