Giter Site home page Giter Site logo

Switch to Guzzle4? about docker-php HOT 7 CLOSED

docker-php avatar docker-php commented on July 2, 2024
Switch to Guzzle4?

from docker-php.

Comments (7)

joelwurtz avatar joelwurtz commented on July 2, 2024

Just see the post, indeed, seems far better than the v3, it will allow docker-php to focus more on docker API and not on request / response stuff.

from docker-php.

joelwurtz avatar joelwurtz commented on July 2, 2024

We need to have our own adapter, as the StreamAdapter of Guzzle 4 only allow to get the response as stream but does not send the request with a stream, it will cause a regression for the memory problem with big context.

from docker-php.

cordoval avatar cordoval commented on July 2, 2024

👍

from docker-php.

ubermuda avatar ubermuda commented on July 2, 2024

@joelwurtz thanks for having a look! Do you think it would be possible to contribute to the existing stream adapter instead of writing a new one completely from scratch?

from docker-php.

joelwurtz avatar joelwurtz commented on July 2, 2024

Yes definitely, i think we have to rewrite the request part in the StreamAdapter and add an option to send the request as a stream.

Actually guzzle send the request by creating a stream_context and populate the header and content option. Then they open the url with "fopen" and passing the context to it : https://github.com/guzzle/guzzle/blob/master/src/Adapter/StreamAdapter.php#L342

We have to wait for this PR also : guzzle/streams#4 as we have a stream from a proc_open pipe and there is no uri so we got an error with the build command.

from docker-php.

joelwurtz avatar joelwurtz commented on July 2, 2024

Also for the moment i only tested with http url (so tcp transport), and i'm not sure it will work with file socket transport, we may also need to write a PR to specify the transport entrypoint for the StreamAdapter to work with unix:///var/run/docker.sock

from docker-php.

joelwurtz avatar joelwurtz commented on July 2, 2024

Solve with #34

from docker-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.