Giter Site home page Giter Site logo

Race? about pipelines.sockets.unofficial HOT 5 CLOSED

mgravell avatar mgravell commented on June 20, 2024
Race?

from pipelines.sockets.unofficial.

Comments (5)

mgravell avatar mgravell commented on June 20, 2024

from pipelines.sockets.unofficial.

henricj avatar henricj commented on June 20, 2024

What we wound up doing was to have an extension method on Stream that creates a pipe, does a Task.Run() on a loop that copies from the pipe to the stream until it sees an empty buffer and with IsCompleted true. The pipe's writer is returned and a the created task is provided as an "out" parameter. A value tuple return with both the PipeWriter and a Task might be an alternative, but we couldn't see a clean way to avoid having two separate things to return.

Perhaps if the reader was guaranteed to complete after the last write propagated to the stream and something like the OnReaderCompleted() callback gunk were wrapped in an extension method?

from pipelines.sockets.unofficial.

mgravell avatar mgravell commented on June 20, 2024

from pipelines.sockets.unofficial.

XCounterAlex avatar XCounterAlex commented on June 20, 2024

CopyFromWritePipeToStream could call reader.complete() on the way to oblivion. That would follow the whole pipelines thing, and PipeWriter.OnReaderCompleted will do the right thing, even if that is a bit

(i'm new to this GitHub thing) so excuse any lack of Etiquette)

from pipelines.sockets.unofficial.

mgravell avatar mgravell commented on June 20, 2024

It will do in the next build

from pipelines.sockets.unofficial.

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.