Giter Site home page Giter Site logo

Comments (5)

AArnott avatar AArnott commented on August 21, 2024

Can you elaborate on why this is useful and can't be reached another way? This doesn't feel like natural stream behavior to have a callback like this.

from nerdbank.streams.

IlyaBiryukov avatar IlyaBiryukov commented on August 21, 2024

This is to support unit tests of streamjsonrpc. In this PR we have to copy-paste FullDuplexStream to achieve it. The idea is to be able to know when writes happen

from nerdbank.streams.

AArnott avatar AArnott commented on August 21, 2024

Could you do that by having a Read or ReadAsync call waiting for the Write operation to come in? Or is that too late?

from nerdbank.streams.

IlyaBiryukov avatar IlyaBiryukov commented on August 21, 2024

Do you mean, can we have a delegate that fires when data arrives to the read end after being written to the duplex stream? I didn't check if this gives us the same timing. In the duplex stream sources it looks like reading is async after writing, so it won't work for us.

from nerdbank.streams.

AArnott avatar AArnott commented on August 21, 2024

I don't mean a delegate. I just mean you have a reader which will unblock as soon as the writer writes to the stream. Yes, this would be slightly later timing than your proposed delegate before writing would give you.

I'm at a loss to think of how to achieve your requirement without adding a rather unnatural "feature" to this library. So I'm leaning toward encouraging you to keep your forked copy of the code for your testing purposes. Ah, the joys of open source. Is there any particular reason that you see that this would be a painful end?

from nerdbank.streams.

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.