GithubHelp home page GithubHelp logo

Comments (11)

fafhrd91 avatar fafhrd91 commented on August 15, 2024

added branch with experimental work https://github.com/KeepSafe/aiohttp/tree/streamreader-payload

@asvetlov what do you think?

from aiohttp.

fafhrd91 avatar fafhrd91 commented on August 15, 2024

i'm going to merge this branch to master.

@asvetlov @popravich @kxepal objections?

from aiohttp.

asvetlov avatar asvetlov commented on August 15, 2024

Sorry, I still have no time for review.
Will do it up to end of Sunday.

from aiohttp.

popravich avatar popravich commented on August 15, 2024

looks good, no objections

from aiohttp.

kxepal avatar kxepal commented on August 15, 2024

Hm. While looks good, it breaks some my code. Currently, if you call ClientResponse.content.read() it reads and emits one single chunk. This allowed to process chunked response chunk by chunk without worry about the details. With streamparser-payload changes it reads and returns all available chunks in one shot and doesn't tries to handle following ones on the next call. However, I didn't looks carefully yet for alternative solution on feature branch, may be I should rewrite some things in different way.

from aiohttp.

fafhrd91 avatar fafhrd91 commented on August 15, 2024

accidentally removed comment :(

from aiohttp.

kxepal avatar kxepal commented on August 15, 2024

Yea, figured that. Was easy to fix.

However, content.readany() isn't proper replacement since still it squashes multiple chunks into one big bytearray. Partially replacement for me was using content.readline() instead, but it makes handling EventSource a bit complex since it's all about new lines. I wonder, may be add content.readchunk() method specially for chunked transfer response? Will try to play around to make PR about if you don't mind.

from aiohttp.

kxepal avatar kxepal commented on August 15, 2024

Was unable to make readchunk() method since it would require to break some things for almost no reason. However, I found that FlowControlDataQueue is perfectly fits the goal and the only what it need is to make it replaceable for FlowControlStreamReader. Check #100 for the related changes.

from aiohttp.

asvetlov avatar asvetlov commented on August 15, 2024

LGTM!

from aiohttp.

fafhrd91 avatar fafhrd91 commented on August 15, 2024

merged

from aiohttp.

lock avatar lock commented on August 15, 2024

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

from aiohttp.

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.