Coder Social home page Coder Social logo

purescript-node-streams-aff's People

Contributors

jamesdbrock avatar jordanmartinez avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

purescript-node-streams-aff's Issues

Change Readable return type signature to a Record

I think I made a mistake designing the API for this package and I regret it.

The reading functions all return type Tuple (Array Buffer) Boolean. Instead they should return type {buffers:: Array Buffer, readagain :: Boolean}.

I don't know if it's worth a breaking change for an aesthetic mistake.

Possible EventEmitter memory leak detected

(node:130773) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 
11 error listeners added to [Socket].
Use emitter.setMaxListeners() to increase limit

When I run the purescript-protobuf conformance test.

readLine

readLine :: forall m r. MonadAff m => Readable r -> m { buffers :: Array Buffer, readagain :: Boolean }

Could we use https://nodejs.org/api/readline.html ?

Instances of the InterfaceConstructor class are constructed using the readlinePromises.createInterface() or readline.createInterface() method. Every instance is associated with a single input Readable stream and a single output Writable stream. The output stream is used to print prompts for user input that arrives on, and is read from, the input stream.

The problem with this is that it requires a Writable stream “used to print prompts”? That seems stupid and I don’t want to require a Writable stream in our API.

If the InterfaceConstructor was created with output set to null or undefined the prompt is not written.

Ok so maybe we just readline.createInterface with a null Writable every time the readLine function is called, handle the 'line' event, and then destroy the interface when the readLine function completes.

canceller

The canceller stuff is all wrong. I understand how the cancellers are supposed to work now: When we receive Aff cancel event, we should cancel the onData, onDrain, et cetera.

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.