GithubHelp home page GithubHelp logo

Comments (6)

dbu avatar dbu commented on July 29, 2024 1

from message.

joelwurtz avatar joelwurtz commented on July 29, 2024

Rewinding the stream is not hard, IF the stream is rewindable :)

If not the current design is broken as we have to replace the stream in the request passed to the formatter but since the request is immutable we cannot update the stream easily.

Then there is some work to do in the plugin calling the formatter which holds the responsability of rewinding / replacing the stream.

from message.

joelwurtz avatar joelwurtz commented on July 29, 2024

Also cloning / rewinding the stream is something that it's used in the cache plugin, maybe we can refactor this part to have an helper stream / class doing this ?

from message.

Nyholm avatar Nyholm commented on July 29, 2024

👍 For a helper class doing this. I did the same hack in an other PR: https://github.com/KnpLabs/php-github-api/pull/389/files#diff-192f7f95a475a8e6e67b97d1c5125367R22

Not too sure how to solve the broken design though... Maybe do not read the stream if it not is rewindable/seekable?

from message.

sagikazarmark avatar sagikazarmark commented on July 29, 2024

Or copy the stream.

from message.

Nyholm avatar Nyholm commented on July 29, 2024

We cant copy the string because the Request is immutable.

I've created a PR.

from message.

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.