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

Make stream get return a stream directly #22

Closed
tpluscode opened this issue Jan 14, 2021 · 3 comments
Closed

Make stream get return a stream directly #22

tpluscode opened this issue Jan 14, 2021 · 3 comments

Comments

@tpluscode
Copy link
Contributor

In the current version (2.x), the StreamQuery#get is implemented to return a Promise<Stream>. This is a little awkward, and an anti pattern as it mixes two way for coding asynchronously

The proposal is to have the promise handled in the library so that stream query returns only a quad stream, unwrapped from the promise.

@cristianvasquez
Copy link
Contributor

Also, the status returned from the endpoint is lost; what would be a good signature for this?

@bergos
Copy link
Member

bergos commented Dec 21, 2022

@cristianvasquez I think this is only relevant for non-2xx status codes, or do you see other use cases? The status code could be attached to the error object like it's done by the http-errors package. Then it's possible to handle all errors with the error event of the stream. HTTP errors will have the status property.

@bergos
Copy link
Member

bergos commented Feb 21, 2024

implemented in #58

@bergos bergos closed this as completed Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants