Coder Social home page Coder Social logo

Comments (4)

tmds avatar tmds commented on May 19, 2024

cc @davidfowl

from bedrockframework.

jkotalik avatar jkotalik commented on May 19, 2024

There was discussion about adding PipeWriter.Append which would take an IMemoryOwner and claim ownership over a block, but I think it was scrapped due to usability issues as you mentioned. It was easy to get into patterns where the consumer would append memory and continue to use that memory after appending. @halter73 has more context as that method existed in Kestrel before.

I'd imagine we'd need to reimplement Pipe.cs in order to add this functionality as well, which is just another barrier.

from bedrockframework.

halter73 avatar halter73 commented on May 19, 2024

This was in the original version of System.IO.Pipelines (called Append like @jkotalik said), but got ripped out in API review because of the usability issues. Kestrel merely had ideas of using this and wasn't relying on this functionality at the time. It would be cool if we could somehow add it back, but I'm not holding my breath.

https://github.com/dotnet/corefxlab/pull/980/files#diff-cbfd130e7c317f2e490d96537111af0bR176-R213

If you can't see the highlighted code, you can expand the diff for PipelineReaderWriter.cs.

from bedrockframework.

davidfowl avatar davidfowl commented on May 19, 2024

I don’t think we should add it back, at least not as a first class thing. I’m not convinced that can be used properly after our experience using pipelines in real software.

Maybe a custom pipe implementation where the caller understood the contract but there’s nothing that can or will be done in this repo to implement cooperative memory management

from bedrockframework.

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.