Comments (4)
Are memory overhead and performance degradation due to message passing significant? If not, advantages are too good to ignore them.
from hackney.
I would like to call out for caution here for the way the GC handles big data. Since it will propably mean sending big binaries around it can lead to keeping a lot of things in memory - I faced exactly that issue [2] when sending chunks read from hackney over messages to another process.
Worst case this could mean that the entire streamed body stays in memory until the hackney streaming process dies (and GC's obviouslly).
@dieswaytoofast has an excelent blog post [1] on that issue (that saved my the behind when I ran into this issue) and I highly recommend reading before this change.
I would opt for keeping both around, let people choose what's right for them like other network sockets work with either async or non async giving different ways to handle reading from the socket. That gives the advantage of staying in line with gen_tcp/udp at least from the philosophy.
[1] http://dieswaytoofast.blogspot.de/2012/12/erlang-binaries-and-garbage-collection.html
[2] https://github.com/project-fifo/sniffle/blob/dev/apps/sniffle/src/sniffle_img_vnode.erl#L345
from hackney.
@kxepal I am trying to see about the real impact, I forgot to add the GC one, thx @Licenser for the link :)
from hackney.
Adding 2 links around this topic to keep a trace somewhere:
http://jlouisramblings.blogspot.fr/2013/10/embrace-copying.html from @jlouis
and
https://blog.heroku.com/archives/2013/11/7/logplex-down-the-rabbit-hole from @ferd
from hackney.
Related Issues (20)
- Incorrect Host header used on redirected requests HOT 2
- Hackney should ignore 1XX responses HOT 1
- Status codes as floats HOT 2
- Connection timeout errors
- Authorization header on redirect
- Need a way to set filename for Content-Disposition when uploading file-data from memory HOT 4
- invalid_proxy_transport - returned with https proxy requesting https host HOT 7
- relative paths in the location header are not properly redirected
- parse_trans needed at runtime?
- Incorrect URL parsing when path is not set and query contains `/` character HOT 2
- Pool connection not freed when response code is 307 (with example! :tada: ) HOT 2
- Failing to access localhost on macOS
- Multiple Cookie headers in request HOT 1
- `content-type` corrupted if supplied as list/string instead of binary HOT 1
- ssl:recv/3 called with negative Length HOT 9
- GET request with basic authorization -- "HTTP request failed: bad_request" HOT 2
- Hackney can not handle very large responses. HOT 1
- FunctionClauseError no function clause matching in :hackney_response.stream_body_recv/2 HOT 6
- DNS lookups with connection pooling
- `secure_renegotiate` and `reuse_sessions` is incompatible with `tlsv1.3`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hackney.