Comments (10)
👍 , fully agree on adding this. My main concern is how to do it non-blocking. A child process could be an option unless you know a good way to do it streaming chunk by chunk in future ticks.
from http-client.
Gzip encoding/decoding should in fact not actually be part of this library. It should be added as a dependency here.
I suppose it makes sense to build this on top of PHP's ZLib functions. I've started looking into building a streaming gzip encoder/decoder a while ago but have never been quite happy with its API.
Can't promise anything, but I'll try to look into this 👍
from http-client.
It should not be part of this library at all but we need to find a way to make it non-blocking so we can use it within this library. A streaming encoder/decoder sounds great and that is something we could use in react/http as well.
from http-client.
make it non-blocking
IMO this is a non-issue for two reasons:
- zlib can easily decompress 100+ MByte/s on even a moderate system
- React PHP's Stream implementation uses usual chunk sizes of 4 KiB each
This means that using a blocking decompressing algorithm for individual chunks can be considered non-blocking for the purpose of this library :-)
(Obviously, this doesn't apply if you're decompressing a multi-megabyte string variable – which does not apply to this library)
from http-client.
Can't promise anything, but I'll try to look into this 👍
Just for the reference, I've started looking into the available implementation approaches a few weeks ago: clue/reactphp-zlib#1
Using PHP's zlib stream filters works okay-ish. I'm currently working around some of its limitations:
clue/reactphp-zlib#3 (comment)
from http-client.
For the reference again, I've pushed an initial v0.1.0 release of clue/zlib-react a few days ago. This can now be integrated here to offer HTTP compression support (gzip
and/or deflate
).
I hear @WyriHaximus is working on this? 👍
from http-client.
Not just working on it, I have a working prototype getting molded into a PR :)
from http-client.
@WyriHaximus What is the status of your prototype?
from http-client.
@CharlotteDunois about 3 and a half years old now so no clue. Feel free to build something because it has been ages
from http-client.
I have to close this one as per #152 now that future development will focus on https://github.com/reactphp/http instead.
I've migrated this ticket to reactphp/http#377.
from http-client.
Related Issues (20)
- Time Out Question HOT 1
- question regarding writing HOT 2
- Hanging connector HOT 1
- Unable to validate "1 " as chunk length header HOT 3
- strtolower() expects parameter 1 to be string, array given HOT 1
- Delay Request Connection HOT 6
- Error on "close" event HOT 8
- How to get the full response body? HOT 1
- [bug]Concurrent with more than 1000 requests. HOT 4
- client pool HOT 1
- Memory leak in SecureConnector HOT 4
- Integrate Server Sent event api (EventSource) or streaming HTTP api HOT 1
- Support detecting response body boundaries HOT 1
- Can this library be used in php-fpm mode? HOT 2
- Trying to POST multipart/form-data HOT 2
- Support for certificate authentication when using HttpClientAdapter HOT 1
- Stop streaming half-way. HOT 1
- Support HTTP upgrades (WebSocket etc.) HOT 1
- is $loop->run(); blocking? HOT 4
- Heads up! Development focus on react/http
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 http-client.