isaacs
530585b2d1
stream: Use push() for readable.wrap()
12 years ago
isaacs
a993f740f0
stream: Add readable.push(chunk) method
12 years ago
Shigeki Ohtsu
1211946a8c
stream: fix typo
Also: Revert "stream: Override addListener as well as on"
This reverts commit 18c985919d
.
12 years ago
isaacs
18c985919d
stream: Override addListener as well as on
For the compatibility switch.
12 years ago
Fedor Indutny
45941811dc
streams: set listener first, emit 'data' later
When switching into compatibility mode by setting `data` event listener,
`_read()` method will be called immediately. If method implementation
invokes callback in the same tick - all emitted `data` events will be
discarded, because `data` listener wasn't set yet.
12 years ago
isaacs
3e6f737eaf
stream: Clean up more effectively in pipe()
12 years ago
Ryunosuke SATO
fde338bf83
stream: speed up instantiation of readable stream
- Stream.apply -> Stream.call
12 years ago
Andreas Madsen
d68ee22dda
stream: do only fake drain when unpiped stream is the source
If the destination had multiply read streams piped to it,
they would all decrease the awaitDrain state and thereby
start the flow
12 years ago
Andreas Madsen
5daa701aba
stream: fix event handler leak in readstream pipe and unpipe
After a stream was unpiped there would stil be residual event handlers
12 years ago
isaacs
f9caf7020c
streams: Speed up by doing less work in the state ctors
12 years ago
isaacs
854171dc6f
streams2: Remove extraneous bufferSize setting
12 years ago
isaacs
04541cf7bc
streams2: Emit pause/resume events
12 years ago
isaacs
8fe7b0c910
streams2: Support a Readable hwm of 0
Necessary for proper stdin functioning
12 years ago
isaacs
8f428f3b0d
streams2: Call read(0) on resume()
Otherwise (especially with stdin) you sometimes end up in cases
where the high water mark is zero, and the current buffer is at 0,
and it doesn't need a readable event, so it never calls _read().
12 years ago
isaacs
fc7d8d59f7
lint
12 years ago
isaacs
dbcacc5afe
streams2: NextTick the emit('readable') in resume()
Otherwise resume() will cause data to be emitted before it can be handled.
12 years ago
isaacs
99021b7a4f
streams2: pause() should be immediate
12 years ago
isaacs
42981e2aad
streams2: Switch to old-mode immediately, not nextTick
This fixes the CONNECT/Upgrade HTTP functionality, which was not getting
sliced properly, because readable wasn't emitted on this tick.
Conflicts:
test/simple/test-http-connect.js
12 years ago
isaacs
83704f1279
streams2: Set readable=false on end
12 years ago
isaacs
d58f2654bc
streams2: Unpipe on dest.emit('close')
12 years ago
isaacs
49ea653363
streams2: Remove pipe if the dest emits error
12 years ago
isaacs
ac5a185edf
streams2: Handle pipeChunkSize properly
12 years ago
isaacs
53fa66d9f7
streams2: Set 'readable' flag on Readable streams
12 years ago
isaacs
4b4ff2dff1
streams2: Refactor out .once() usage from Readable.pipe()
12 years ago
isaacs
38e2b0053a
streams2: Get rid of .once() usage in Readable.pipe
Significant performance impact
12 years ago
isaacs
b15e19a232
streams2: Remove function.bind() usage
It's too slow, unfortunately.
12 years ago
isaacs
2ff499c022
streams2: Do multipipe without always using forEach
The Array.forEach call is too expensive.
12 years ago
isaacs
286c54439a
streams2: Only emit 'readable' when needed
12 years ago
isaacs
62dd04027b
streams2: Set Readable lwm to 0 by default
12 years ago
isaacs
f20fd22abd
streams2: Add high water mark for Readable
Also, organize the numeric settings a bit on the ReadableState class
12 years ago
isaacs
63ac07b32b
streams2: Export Readable/Writable State classes
12 years ago
isaacs
286aa04910
streams2: Abstract out onread function
12 years ago
isaacs
f624ccb475
streams2: Use StringDecoder.end
12 years ago
isaacs
cf0b4ba410
streams2: flow() is not always bound to src
12 years ago
isaacs
545f512619
streams2: ctor guards on Stream classes
12 years ago
isaacs
8acb416ad0
streams2: Handle immediate synthetic transforms properly
12 years ago
isaacs
02f017d24f
streams2: Allow 0 as a lowWaterMark value
12 years ago
isaacs
3b59fd70f4
streams2: Make Transform streams pull-style
That is, the transform is triggered by a _read, not by a _write.
This way, backpressure works properly.
12 years ago
isaacs
9b5abe5bfe
streams2: setEncoding and abstract out endReadable
12 years ago
isaacs
51a52c43a2
streams2: Set flowing=true when flowing
12 years ago
isaacs
420e07c577
streams2: The new stream base classes
12 years ago