purescript-deprecated / purescript-node-streams-aff Goto Github PK
View Code? Open in Web Editor NEWPureScript package for asynchronous Node.js stream API.
License: MIT License
PureScript package for asynchronous Node.js stream API.
License: MIT License
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.
A lot of the necessary features in the Internal module will soon be available available in Node.Stream.
https://discourse.purescript.org/t/rfc-eventemitter-bindings-and-http2-bindings/3584
(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 :: 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 thereadlinePromises.createInterface()
orreadline.createInterface()
method. Every instance is associated with a singleinput
Readable
stream and a singleoutput
Writable
stream. Theoutput
stream is used to print prompts for user input that arrives on, and is read from, theinput
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 withoutput
set tonull
orundefined
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.
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.
Should this be?
s.once('error', (error) => f(error)());
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.