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

Stream read query #39

Open
sonic182 opened this issue May 13, 2022 · 5 comments
Open

Stream read query #39

sonic182 opened this issue May 13, 2022 · 5 comments

Comments

@sonic182
Copy link

The lib doesn't support read response as stream isn't it?

@sofakingworld
Copy link
Member

Yes, lib doesn't support this.

Is this supported via HTTP?

@sonic182
Copy link
Author

sonic182 commented May 13, 2022

Yes, when the server respond with headers Transfer-Encoding: chunked and then, the body is <chunk_size><chunk><chunk_size><chunk>.... See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding#examples

elixir Finch lib support this (uses Mint under the hood), with Finch.stream/5 method. I have use Finch because I needed to download clickhouse response in stream

HTTPoison supports async responses too but I don't recommend any use of HTTPoison because of hackney latest versions...

@sonic182
Copy link
Author

You can simplify this package A LOT by just using Finch, which already provides pool of conns

@sofakingworld
Copy link
Member

Right now we paused development of Pillar until September, in this way i advise you to make fork with branch #26 and add Finch HTTP Client

@hkrutzer
Copy link
Contributor

With a stream if you need to query a lot of data to do processing on, you can do so without buffering everything first. I also need this and I think @sonic182 is right that Finch seems like a great option, as it does pooling out of the box and also supports streaming.

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