Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit close/reconnect events on StreamConnections #529

Open
CJxD opened this issue Nov 25, 2024 · 0 comments · May be fixed by #530
Open

Emit close/reconnect events on StreamConnections #529

CJxD opened this issue Nov 25, 2024 · 0 comments · May be fixed by #530
Assignees
Labels
api: bigquerystorage Issues related to the googleapis/nodejs-bigquery-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release.

Comments

@CJxD
Copy link

CJxD commented Nov 25, 2024

A screenshot that you have tested with "Try this API".

N/A

What would you like to see in the library?

When using the managedwriter StreamConnection class (as returned by WriterClient.createStreamConnection()), I found that the connection often needs to reconnect, but my calling code is unable to determine when this happens.

I need to do this because the protoDescriptor needs to be specified for the first write in a connection, but not for subsequent writes, so I need to reset my state to know if I need to write the protoDescriptor again.

Describe alternatives you've considered

My workaround hack was to do (stream as any)._connection.on('close', ... and to reregister the listener every time the connection changes, but it would be great to listen to an event directly.

Additional context/notes

No response

@product-auto-label product-auto-label bot added the api: bigquerystorage Issues related to the googleapis/nodejs-bigquery-storage API. label Nov 25, 2024
@CJxD CJxD linked a pull request Nov 25, 2024 that will close this issue
CJxD pushed a commit to CJxD/nodejs-bigquery-storage that referenced this issue Nov 25, 2024
* feat: emit stream events in stream_connection.ts (googleapis#529)
CJxD added a commit to CJxD/nodejs-bigquery-storage that referenced this issue Nov 25, 2024
* feat: emit stream events in stream_connection.ts (googleapis#529)
@alvarowolfx alvarowolfx added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Nov 25, 2024
@alvarowolfx alvarowolfx self-assigned this Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquerystorage Issues related to the googleapis/nodejs-bigquery-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants